I'm trying to take some delphi code and convert it over to C# to test something. So I copied all of the code and made some search and replaces. Eventually I get to the point it looks like this.
Now I have about 50 lines that look like that. Okay simple! I'll use a regular expression, right? So the first thing I want to do is to change it so that it looks like this:
(Now for those just skimming, I'm making incremental steps to go from Delphi to C#. So yes, I know that it's not correct at that phase.)
Easy, I'll use the expression "(\.\w+)\(" and replace it with "\1 = ". But then I try it and the IDE says it can't find (\.\w+)\( Huh? So I test out (\.\w+) and it finds it. Okay, so I fire up everyone's favorite regex site regexlib.com I pasted my regex and my code and it works exactly the way I would expect on regexlib. This isn't the first time I've struggled with regex searches with Visual Studio (one time it worked however I could only see \0 and not \1). So is it just broke? Or am I truly doing something wrong?
Moved byCoolDadTxModeratorMonday, November 23, 2009 2:56 PMC# related (From:Visual C# IDE)
Moved byChao KuoWednesday, November 25, 2009 9:19 AMactually regular expression related (From:Visual C# General)