October 15th, 2006 | No Comments
Regular Expression Resources
Regular Expressions (RegEx) are something that all web developers will need to use at some time or other (and if they use don’t use them, they probably should).
According to Wikipedia:
A regular expression (abbreviated as regexp or regex, with plural forms regexps, regexes, or regexen) is a string that describes or matches a set of strings, according to certain syntax rules.
Examples of where you’d use a regular expressions would be for validating email addresses or postcodes in a web form - where you must match the visitor’s data entry against your chosen format.
Although the RegEx concept is pretty simple, building complex regular expressions can get quite confusing.
Luckily, as with most programming topics, there are plenty of resources available to help you get your head around it. In the last few weeks there I have come across a few good RegEx tutorials and resources.
Sitepoint has recently published a three-part RegEx tutorials for PHP:
- The Joy Of Regular Expressions Part 1 - Some background and some basics.
- The Joy Of Regular Expressions Part 2 - Search and replace in RegEx.
- The Joy Of Regular Expressions Part 3 - A round up of RegEx syntax.
There’s also the very useful Regular Expressions Cheat Sheet from ILoveJackDaniels.
Finally, there’s the Regex Library which is a place to find various pre-made RegEx patterns, which may also give you a few pointers for developing your own patterns.
