PHP regular expressions for web developers
Regular 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
posted in Utilities, PHP, Studies, Ideas, Web Tools | 0 Comments





