Stupid Question 63: ’Regular Expression’ syntax, are there variations?
regular expression syntax, does it vary?
I haven’t been using regular expressions a lot, and when I have I have relied on the help from others. Although feeling slightly uncomfortable with the symbols that my brain seems unable to box into some sort of logic, I find regular expression rather neat. They have not been on my to do list, basically because I haven’t considered knowing that a necessity. But while being a bit bored waiting to fall asleep last night, I decided to google.
I knew that regular expression is a sort of search language (this is the best way I can describe it, but I know it’s not a 100% accurate description- read my answer below), and if this is the case,- then there must be variations? Right?
Here is what I learned,
The .NET supports regular expressions which come from Perl 5. It is provided through a library (so does Java and Python), while Perl and Ruby integrate regular expressions in the language itself. There is usually an engine, a regular expression processor that identifies the patterns and does the parsing. These two actions are the minimum, in .Net we can replace as well as search. And yes, there are differences, based on the engine used, and type of integration and ‘language origin’. While I’m not aware of the differences, there is a book called Mastering Regular Expressions that describes Java, PHP, Perl and .Net implementation. I’m going to get this book, and read it, and update this blog post once I know :)
Would be totally awesome if some regex expert would like to share their wisdom :D Comments are supre-welcome!
Last modified on 2012-10-19