.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Regex for number seq. between 1 -16 eg: 1,2, 4-8,12

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

Can some one help about for the reular expression for a range of Numbers between 1 -16. The possibility of occurance of these numbers are like a printing document sequnce eg: 1, 2-10, 16 or 1, 4,  5-12 soon




View Complete Post

More Related Resource Links

Regex for checking number greater than 9

Hi All , I need to write a regex which can check for a number greater than equal to 9 .  

[regex] Extracting number preceding a particular text (in this case area unit).

Hi there, I'm looking for a regex to extract two numbers from the same text (they can be run independently, no need to extract them both in one go. I'm using yahoo pipes. Source Text: S$ 5,200 / month Negotiable, 1,475 sqft / 137 sqm (built-in) - Apartment, 10 Anson Road (D02) Need to extract as a number: 1,475 and also (but can be extracted on a separate instance) Need to extract as a number: 137 any guidance will be greatly appreciated. thanks in advance Paco

Regex: password must contain one number, one letter, and 0 or more special chars


I'm trying to validate a password, and I'm almost there, but need some help finishing it off. Here's what I need:

1) 6-10 characters

2) At least one alpha AND one number

3) The following special chars are allowed (0 or more): !@#$%

Here's what I have:


Passwords that should work: test1ng, abc123, abc1234567, 123abc, abc!123, !@#$%1abcd, !@#$%a9

Passwords that shouldn't work: a, 1, a1, 1$, %, abc!@#, 012345, a1234+, abcde, test*ng, abcde!, !@#$%!, a1234567890, testit!0987, 1abcdefghij

It works on all my test cases, except it allows "a1234567890", "testit!0987", and "1abcdefghij", none of which should be allowed, since they contain more than 10 chars. What am I missing?

Regex match a number between 100 and 200 and no letters


Hello i`m new in regex and i relly need some help how to fin a solution in this problem

match a number between 100 and 200 inclusive and no letters allowed

Thx in advance hope some one will help me with this

Best regards


what is the "." for in a phone number regex?

      string phone = "973 555-7241";
      string pat = @"^\d{3}[- .]?\d{3}[- .]?\d{4}$";
      Match rv = Regex.Match(phone, pat);

What does the "." in the section "[- .]" of the above regex pattern mean?

I understand "." to mean 'any char but newline". Square brackets contain a set of chars, any of which can match the current character. [ -] means "either space char or dash char".  I read "[- .]" to mean any of "dash, space or any char other than new line".  But something like 973x555-1212 does not match the regex.



how to use regex to identify the number of links in html source code


Hi, all, how to count the number of links in a piece of html source code, is it possible to use regex, for example, create a regex "href" and to count for matches? thanks in advance.

for example, a segment of html code like this:

<TD style="PADDING-RIGHT: 3px" width=150><A id=a588660 onclick="return Evar16_tracking('588660');" href="/products/shprodde.asp?sku=588940"><IMG style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

Article commenting by line number


I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.

The number of members in the conceptual type ... does not match with the number of members on the ob



I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error:

The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.

This happens at the following line in global.asax:
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });

Please help!

huge number of data from database ... so how to minimize load time


Hi ...

I have used the above method to configure my crystal report ...

Its working fine , But i have huge number of data in database ....

So , it take long time to load the report ...

So , i have decided to show only the last 50 records inserted into the database , not all the 500 records to be loaded every time.

Plz help me with this issue  ...


Also , Plz explain me abt index legend in crystal report.

Regex pattern for validating IPv6


Can anyone can make a regular expression pattern for validating IPv6 (not IPv4)?

Ipv6 has many formats and aliases. I tried making the pattern but written in a lot of codes (i'm not sure my code below will be 100% accepting valid formats and 100% declines invalid formats).


How to show 0 as first number in column


Hi guys. I have two little problem.

I have database with one table and it has 4 rows.

1. I want to show a zero in front of all number. Actually i added but it doesn't show.

2. If i don't put any value in column is it possible to have minus for example instead of 0?




I post it like that because i can't see how to post pics directly.

P.S. The columns with numbers have checked "allow nulls".

I draw in paint so it's not so good but i think it's understandable.

10x in advance.

'Meter number is not registered ' error FedEx ship web service move to production



I want to integrate FedEx ship web service in my website. It works fine for local but for production it gives error. I changed test credentials by production credentials. also changed test url "https://gatewaybeta.fedex.com:443/webservices" by production url "https://gateway.fedex.com:443/webservices" But I am getting error that meter number is not registered. Please advice.

Function to return number


I am trying to create a function that  return the number part within / / from a url if exist:

For exmple:

http://www.mydomain.com/Mobile_Exec/1234/Orange_revamps_business_website.aspx SHOULD RETURN "\1234\"

http://www.mydomain.com/News/Orange_revamps_business_website.aspx    SHOULD RETURN "\\"

http://www.mydomain.com/News/Features/627362/Orange_revamps_business_website.aspx SHOULD RETURN "\627362\"

I prefer if possible to use regular expression. Any help would be really appreciated.

Regex.replace [h2] to


I try to replace [h2] to <h2>
I use this coding:

string o = "<h2>test</h2>";
o = Regex.Replace(o, "[h2]", "<h2>");
o = Regex.Replace(o, "[/h2]", "</h2>");


But the result after the first regex is:


So that is not what i want.
After the first 1, he should make:


Whats wrong?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend