hi,
i'm a newbie to regex....
i need to check if a given string has more than two occurences of . in the
begiining of string
for ex, if string has value .test is valid but ..test is invalid
Can you help me out with the pattern for such strings?
Alex Meleta - 29 May 2007 17:22 GMT
match patterns:
^[.]{2,}\w+
[if a given string has more than two occurences of [dot] .]
^[.]\w+
[if string has value .test is valid but ..test is invalid]
WBR, Alex Meleta
Blog:: devkids.blogspot.com
A> hi,
A> i'm a newbie to regex....
A> i need to check if a given string has more than two occurences of .
A> in the begiining of string
A>
A> for ex, if string has value .test is valid but ..test is invalid
A>
A> Can you help me out with the pattern for such strings?
A>
Andrew Christiansen - 29 May 2007 17:24 GMT
This would acheive the same thing, but without using regular expressions.
If String.StartsWith(".") = True And String.StartsWith("..") = False Then
'String starts with only one period.
Else
'String starts with no periods or starts with more than one period.
End If
- Andrew
> hi,
> i'm a newbie to regex....
[quoted text clipped - 5 lines]
>
> Can you help me out with the pattern for such strings?
Kevin Spencer - 29 May 2007 21:23 GMT
I answered this in microsoft.public.dotnet.framework.

Signature
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
> hi,
> i'm a newbie to regex....
[quoted text clipped - 5 lines]
>
> Can you help me out with the pattern for such strings?
OmegaMan - 07 Jun 2007 05:45 GMT
Check out the MSDN's .Net Regular Expression forum for help with regex'es and
the top announcement .Net Regex Resource Reference which has referential
information geared towards all levels from expert to beginner.
Forum:
http://forums.microsoft.com/MSDN/User/MyForums.aspx?SiteID=1
Top Post
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1131272&SiteID=1