473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

RegularExpressionValidator help please!

Using a RegularexpressionValidator to control that a user types in correct
in a textbox:

The expression I have is this: \d{2},\d{4}

This means the user shall type in something like this "10,2004", This is
supposed to be a weeknumer comma year.

Since there are a maximum of 53 weeks in a year.. how do I check so that the
user do not type in a value exceeding 53 on the first two numers?

Please help
/Lars Netzel
Nov 19 '05 #1
4 911
Try:
([0-4]\d|5[0-3]),\d{4}

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Lars Netzel" <no****@doamin.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Using a RegularexpressionValidator to control that a user types in correct
in a textbox:

The expression I have is this: \d{2},\d{4}

This means the user shall type in something like this "10,2004", This is
supposed to be a weeknumer comma year.

Since there are a maximum of 53 weeks in a year.. how do I check so that the user do not type in a value exceeding 53 on the first two numers?

Please help
/Lars Netzel

Nov 19 '05 #2
thanx but nothing worked after that one!

I neeed to be able to type 1-53 before the comma

/Lars

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:er**************@TK2MSFTNGP14.phx.gbl...
Try:
([0-4]\d|5[0-3]),\d{4}

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Lars Netzel" <no****@doamin.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Using a RegularexpressionValidator to control that a user types in
correct
in a textbox:

The expression I have is this: \d{2},\d{4}

This means the user shall type in something like this "10,2004", This is
supposed to be a weeknumer comma year.

Since there are a maximum of 53 weeks in a year.. how do I check so that

the
user do not type in a value exceeding 53 on the first two numers?

Please help
/Lars Netzel


Nov 19 '05 #3
Ah, your original email led me to believe that 1 would be entered as
01...try:
^([0-4]?\d|5[0-3]),\d{4}$

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Lars Netzel" <no****@doamin.com> wrote in message
news:en**************@TK2MSFTNGP09.phx.gbl...
thanx but nothing worked after that one!

I neeed to be able to type 1-53 before the comma

/Lars

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:er**************@TK2MSFTNGP14.phx.gbl...
Try:
([0-4]\d|5[0-3]),\d{4}

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Lars Netzel" <no****@doamin.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Using a RegularexpressionValidator to control that a user types in
correct
in a textbox:

The expression I have is this: \d{2},\d{4}

This means the user shall type in something like this "10,2004", This is supposed to be a weeknumer comma year.

Since there are a maximum of 53 weeks in a year.. how do I check so
that the
user do not type in a value exceeding 53 on the first two numers?

Please help
/Lars Netzel



Nov 19 '05 #4
Thank you that worked:)

/Lars

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Ah, your original email led me to believe that 1 would be entered as
01...try:
^([0-4]?\d|5[0-3]),\d{4}$

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Lars Netzel" <no****@doamin.com> wrote in message
news:en**************@TK2MSFTNGP09.phx.gbl...
thanx but nothing worked after that one!

I neeed to be able to type 1-53 before the comma

/Lars

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:er**************@TK2MSFTNGP14.phx.gbl...
> Try:
> ([0-4]\d|5[0-3]),\d{4}
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "Lars Netzel" <no****@doamin.com> wrote in message
> news:%2****************@TK2MSFTNGP14.phx.gbl...
>> Using a RegularexpressionValidator to control that a user types in
>> correct
>> in a textbox:
>>
>> The expression I have is this: \d{2},\d{4}
>>
>> This means the user shall type in something like this "10,2004", This is >> supposed to be a weeknumer comma year.
>>
>> Since there are a maximum of 53 weeks in a year.. how do I check so that > the
>> user do not type in a value exceeding 53 on the first two numers?
>>
>> Please help
>> /Lars Netzel
>>
>>
>
>



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Eshtry | last post by:
I have a radio button list, a textbox representing SIN or EIN based on my radio button list selection so I put 2 regularexpressionvalidator to evaluate the value of textbox. EIN must be (for...
3
by: Ricardo Corsi P. Cesar | last post by:
Hi, i looking for example in asp.net (VB) to make the RegularExpressionValidator in runtime in my code behind. I found some similars codes, but nothing in VB.. thanks!
3
by: DC | last post by:
I have this snippet: <tr> <td align="left">E-mail</td> <td> <asp:TextBox id="txtEmail" runat="server" MaxLength="100"></asp:TextBox>&nbsp; <asp:RegularExpressionValidator id="revEmail"...
0
by: venkat Murthy | last post by:
Hi, I have 10 regularexpression validators in my datagrid. my datagrid looks like; first5controls | boundcolumn | next5controls. Regularexpressionvalidator for first five controls works...
1
by: franz | last post by:
does anybody tell me why it doesn't works?? in any case gg beame true thanks franz Dim y As RegularExpressionValidator = New RegularExpressionValidator y.ValidationExpression =...
1
by: John Yopp | last post by:
I'm trying to use a asp:RegularExpressionValidator to validate the strength of a password. When I test the regular expression with Regex.IsMatch, it works perfectly. However, when used within a...
0
by: Oren | last post by:
hi again, i have this code: <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ErrorMessage="max 255 chars" ControlToValidate="text1"...
4
by: =?Utf-8?B?Y3VyaW91cw==?= | last post by:
I am using a RegularExpressionValidator to validate a TextBox. I use "^?+(\.*)?$" to check for a real number. The control works fine as long as the user enters something in the TextBox; it does not...
0
by: alastair.slater | last post by:
Hi all, Can anyone help please? I'm using the following code to validate a password entered by new users in an <asp:Textbox ... />: <asp:RegularExpressionValidator ID="RegularPassword"...
4
by: =?Utf-8?B?RGF2ZSBXZWVkZW4=?= | last post by:
Hi, I seem to have found a bug in the regular expression validator under firefox 2.0.0.15 when I use saved form field values. Specifically I have an email address validator for a text box that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.