Section 15.8. The Regular Expressions Coach


15.8. The Regular Expressions Coach

Although there is no doubt that regular expressions are incredibly useful, they also easily get out of hand when trying to match complex strings. Furthermore, anything past twelve or so characters gets hard to read and understand, which is a common source of bugs.

To work around this problem, I suggest you use a program called the Regex Coach (pictured in Figure 15-1), available from http://www.weitz.de/regex-coachit is free to use non-commercially, and it is able to help you check that your regular expressions are correct by visually highlighting strings that match. The Coach is fully compatible with all the options shown here, including string replacement, and can even break down a regexp and describe it in plain English.

Figure 15-1. Use the Regex Coach to try out regular expressions and get instant feedback




PHP in a Nutshell
Ubuntu Unleashed
ISBN: 596100671
EAN: 2147483647
Year: 2003
Pages: 249

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net