October 17, 2018
Hot Topics:

10 Number-based Examples for Deciphering PHP Regular Expressions

  • July 21, 2010
  • By Jason Gilmore
  • Send Email »
  • More Articles »

PHP regular expression syntax is almost as indecipherable as the United States tax code, prompting the programmer to consult a manual almost automatically every time he or she needs to perform a particularly complex parsing task. If you're one of those programmers who would like to decipher the mish-mash of backslashes, brackets, asterisks and other characters that somehow can root out everything from email addresses to HTML tags, Jason Gilmore has written a PHPBuilder.com tutorial just for you. He introduces PHP regular expressions using 10 numerically-oriented examples.

  1. Finding digits
  2. Finding groups of digits
  3. Filtering unwanted strings
  4. Expanding your range
  5. Increasing your selectivity
  6. Finding more complex patterns
  7. Accounting for inconsistency
  8. Correcting errors
  9. Taking advantage of alternative syntax
  10. Avoiding regular expressions

With these examples and some practice, constructing even complex regular expressions will become as natural as riding a bicycle.

Read the full story at PHPBuilder:
10 Easy Examples for Deciphering PHP Regular Expressions

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date