Okay, okay, so I know I’m a bit behind the curve on this one, but I just wrote my first code in .NET that uses regular expressions! Over the years I’ve used regular expressions in AWK, sed, and most recently PHP. I understand the power of regular expressions, but have never gotten to a level of being very proficient in their use. About a year or so ago when I decided to learn PHP so I could hack together some web sites I realized I needed to use regular expressions if I wanted to get anywhere. I used regular expressions within PHP to parse HTML pages. I found it to be pretty painless and felt that PHP was the way to go if I needed any regular expression processing.
Fast forward to today… I’m building a new ASP.NET web site (top secret, can’t give you any details :)) and came up with an idea for some cool functionality, but the only reasonable way to provide the functionality was going to require the use of regular expressions. My first thought was "how can I call PHP from ASP.NET?". Then I remembered that .NET has support for regular expressions in the System.Text.RegularExpressions namespace. I decided that I’d give it a look.
There are certainly some syntactic differences between PHP and .NET around how to invoke and process results, but (as you would hope) the syntax for defining the regular expression is pretty much the same. With a few Google searches to get some example code I was able to get me code to do what I wanted to.
Now that I have regular expressions working in .NET, I have one less reason to consider using PHP! Not that PHP is bad, but my comfort and skill is definitely more along the .NET side of the world.