31st July 2009

PHP regular expressions for web developers

posted in Utilities, PHP, Studies, Ideas, Web Tools |

regex.jpgRegular expressions are a very useful tool for developers. They allow to find, identify or replace text, words or any kind of characters. In this article, I have compiled 15+ extremely useful regular expressions that any web developer should have in his toolkit.

 Topics Covered

  • Regular expressions syntax
  • PHP regular expression functions
  • Validate domain name
  • Enlight a word from a text
  • Enlight search results in your WordPress blog
  • Get all images from a HTML document
  • Remove repeated words (case insensitive)
  • Remove repeated punctuation
  • Matching a XML/HTML tag
  • Matching an XHTML/XML tag with a certain attribute value
  • Matching hexadecimal color values
  • Find page title
  • Parsing Apache logs
  • Replacing double quotes by smart qutotes
  • Checking password complexity
  • WordPress: Using regexp to retrieve images from post
  • Generating automatic smileys

Here is the complete article

This entry was posted on Friday, July 31st, 2009 at 1:28 pm and is filed under Utilities, PHP, Studies, Ideas, Web Tools. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.