Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regular Expressions or (Hey Microsoft RegEx standards)
Message
From
05/03/2006 21:22:57
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Regular Expressions or (Hey Microsoft RegEx standards)
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01101609
Message ID:
01101609
Views:
51
OK, Gang this is an issue I may be over complicating. Is anyone else using regex in the following manner in .NET not perl?

Say I have a string such as "www.MyCoolSite.Com" and I need domain parts I would use a regex as follows "(www\.)(.*)(\.com)" or "{www\.}{.*}{\.com}" and I can format the output as "Part 2: $2 Part 1: $1 Part 3: $3" or "Part\ 2\:\ \2 Part\ 1\:\ \1 Part\ 3\:\ \3" returning a result of "Part 2: MyCoolSite Part 1: www. Part 3: .com"

My real question lies at the ors above... Is there some rhyme or reason as to when to use the proper \1 vs. $1 and also the {} vs. () ... I have not really seen the consistancy I would hope for. Seems like asp.net code behind in vb.net seems to want the paren and dollar combo but in winform vb.net the slashes are good. Whats up with the inconsistancy.

My very humble thanks in advance,
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Reply
Map
View

Click here to load this message in the networking platform