Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

need help on regex

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AVL - 29 May 2007 16:08 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.