I might be missing something
-
If I were to use regex at all in the replacement string, I'd be doing a capture in the search and using the captured object in the replacement, which is one level of difficulty above what I was trying to do.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Sorry - I see I misread your requirement - I thought you DIDN'T want to replace the numbers!
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
How are you replacing? post the code here
It’s always a pleasure to help when your efforts are appreciated...
There is no code. CTRL-Shift-H. Replace dialog in visual studio.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
There is no code. CTRL-Shift-H. Replace dialog in visual studio.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Christian Graus wrote:
CTRL-Shift-H. Replace dialog in visual studio.
:omg: you can't do that, its not dynamic it is static so you have to do it one by one
It’s always a pleasure to help when your efforts are appreciated...
-
_Damian S_ wrote:
JustWorking wrote:
Christian Graus wrote:
I was waiting on the other end of
hte house for him to finish...FTFY :laugh:
No you didn't!!
Yes I did :laugh: I cought Christian saying hte :laugh: Now we shell call him Mr. hte ;P
It’s always a pleasure to help when your efforts are appreciated...
JustWorking wrote:
cought
Just so you know... it's caught!!
Silence is golden... but duct tape is silver!! Booger Mobile - My bright green 1964 Ford Falcon - check out the blog here!! | If you feel generous - make a donation to Camp Quality!!
-
Christian Graus wrote:
CTRL-Shift-H. Replace dialog in visual studio.
:omg: you can't do that, its not dynamic it is static so you have to do it one by one
It’s always a pleasure to help when your efforts are appreciated...
Wow - so the regex search and replace is useless then ? Great. Thanks for helping me. Do you have any link that explains why they didn't bother to make this useful at all ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Sorry - I see I misread your requirement - I thought you DIDN'T want to replace the numbers!
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
No, I hoped I could use regex to replace a bunch of SIMILAR strings with the same value.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I was replacing s=c&vl=vlg&vi=\d* with a blank string, just a space. It replaces s=c&vl=vlg&vi= and doesn't replace the digits on the end. The digits are 1-3 digits, as in s=c&vl=vlg&vi=1 s=c&vl=vlg&vi=2 s=c&vl=vlg&vi=10 s=c&vl=vlg&vi=11 s=c&vl=vlg&vi=33 s=c&vl=vlg&vi=101 etc. I'd end up with 1 2 10 11 33 101 and, of course, if I just search for that term, it finds all the matches in my file. Oh - is this a case where I need to use a greedy operator ? *doh* (Edit) I don't use regex that often, but it appears to me that my operator is fine, I don't see any alternative to use....(/Edit)
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
modified on Tuesday, June 28, 2011 12:14 AM
s=c&vl=vlg&vi=[0-9]+
Christian Graus wrote:
Oh - is this a case where I need to use a greedy operator ? *doh*
Searches should be greedy by default (maybe not in Visual Studio). In C#, ? will make it non-greedy.
Driven to the ARMs by x86.
-
Wow - so the regex search and replace is useless then ? Great. Thanks for helping me. Do you have any link that explains why they didn't bother to make this useful at all ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
It is called Find and Replace no search and replace :doh:
It’s always a pleasure to help when your efforts are appreciated...
-
Wow - so the regex search and replace is useless then ? Great. Thanks for helping me. Do you have any link that explains why they didn't bother to make this useful at all ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
I would love to see some green between mu posts :rolleyes:
It’s always a pleasure to help when your efforts are appreciated...
-
But isn't it counter intuitive that if I do a search and replace using regex, the regex portion of what I find, is not replaced ? Ooops - in Visual Studio.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
JGSoft - Regex Magic: works wonders. Don't leave home with out it.
try {
if (Regex.IsMatch(subjectString, "")) {
// Successful match
} else {
// Match attempt failed
}
} catch (ArgumentException ex) {
// Syntax error in the regular expression
}----------------------------- Just along for the ride. -----------------------------
-
Not really. I looked up "search" and "replace" and sure enough, they are different concepts in Ameriglish. Not sure about Austraglish, though. I love the way good editors like vi let you search for something and replace something else. It's saved me lots of time and effort on many an occasion.
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
That is because vi uses grep.
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
I was replacing s=c&vl=vlg&vi=\d* with a blank string, just a space. It replaces s=c&vl=vlg&vi= and doesn't replace the digits on the end. The digits are 1-3 digits, as in s=c&vl=vlg&vi=1 s=c&vl=vlg&vi=2 s=c&vl=vlg&vi=10 s=c&vl=vlg&vi=11 s=c&vl=vlg&vi=33 s=c&vl=vlg&vi=101 etc. I'd end up with 1 2 10 11 33 101 and, of course, if I just search for that term, it finds all the matches in my file. Oh - is this a case where I need to use a greedy operator ? *doh* (Edit) I don't use regex that often, but it appears to me that my operator is fine, I don't see any alternative to use....(/Edit)
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
modified on Tuesday, June 28, 2011 12:14 AM
Got me. It looks like it should work. :confused: PS - I don't know why you were 1 voted on your previous post so I voted 5 to counteract, not because I thought it was a brilliant post.
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes