December 19, 2014
Hot Topics:

10 Number-based Examples for Deciphering PHP Regular Expressions

  • July 20, 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


Tags: PHP




Comment and Contribute

 


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

 

 


Enterprise Development Update

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

Sitemap | Contact Us

Rocket Fuel