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