In my experience, .NET supports the same functions as Perl regular expressions, but the syntax is much more verbose, so it needs a little use.
C # does not support the concept of implicit variables, so you always need to supply both the input string and the matching pattern. In other words, this abbreviation, missing in .NET, is not an explicit mapping through = ~ and! ~.
Regex.Match does the same as = ~ if you just want to find matches. If you want to combine and replace, you must use the Replace method. For the operator! ~ You just need to use! and the corresponding Regex method.
It takes a little more text input, but you can get the effect you are looking for.
Brian Rasmussen Feb 07 '09 at 7:50 2009-02-07 07:50
source share