|
|
|
start date: Thu, 16 Aug 2007 14:35:17 -0400,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
George Ter-Saakov
|
|
2
Alexey Smirnov
|
|
3
Alexey Smirnov
|
|
4
George Ter-Saakov
|
|
5
George Ter-Saakov
|
Regex problems
I need a regular expression that would validate string like this.
aa5677
Any 2 literal characters and then any amount of digits from 1 to ...
aa345k is not valid.
Can someone write this for me.
Thanks
George.
Date:Thu, 16 Aug 2007 14:35:17 -0400
Author:
|
Re: Regex problems
On Aug 16, 8:35 pm, "George Ter-Saakov" wrote:
> I need a regular expression that would validate string like this.
>
> aa5677
>
> Any 2 literal characters and then any amount of digits from 1 to ...
> aa345k is not valid.
>
> Can someone write this for me.
>
> Thanks
> George.
^[a-zA-Z]{2}\d*$
Date:Thu, 16 Aug 2007 11:41:36 -0700
Author:
|
Re: Regex problems
On Aug 16, 8:35 pm, "George Ter-Saakov" wrote:
> any amount of digits from 1 to ...
Ah, change ( * ) to ( + ), like this
^[a-zA-Z]{2}\d+$
it will require at least one digit
Date:Thu, 16 Aug 2007 11:43:55 -0700
Author:
|
Re: Regex problems
Thanks, saved me one headache today :)
George.
"Alexey Smirnov" wrote in message
news:1187289696.573266.278400@k79g2000hse.googlegroups.com...
> On Aug 16, 8:35 pm, "George Ter-Saakov" wrote:
>> I need a regular expression that would validate string like this.
>>
>> aa5677
>>
>> Any 2 literal characters and then any amount of digits from 1 to ...
>> aa345k is not valid.
>>
>> Can someone write this for me.
>>
>> Thanks
>> George.
>
> ^[a-zA-Z]{2}\d*$
>
Date:Thu, 16 Aug 2007 14:46:40 -0400
Author:
|
Re: Regex problems
Yea, thanks
I figured that one myself
After an hour of reading MSDN I gave up and wrote to you guys. But now I
know something about Regex
George.
"Alexey Smirnov" wrote in message
news:1187289835.035382.194800@22g2000hsm.googlegroups.com...
> On Aug 16, 8:35 pm, "George Ter-Saakov" wrote:
>> any amount of digits from 1 to ...
>
> Ah, change ( * ) to ( + ), like this
>
> ^[a-zA-Z]{2}\d+$
>
> it will require at least one digit
>
Date:Thu, 16 Aug 2007 14:59:45 -0400
Author:
|
|
|