8 Most useful regular expressions

Regular expression also known as regex or regexp is a sequence of characters that forms a search pattern. It is used by most of the programming language like php, javascript, perl etc.

Here is the list of most useful regular expressions for webmasters. To test them on text string use our Regular expression testing tool.

Regular expression for username

Following pattern will match alphanumeric string including “_” of length 3 to 16.


Regular expression for email


Regular expression for URL


Regular expression for Domain Name


Regular expression for IP-address

This will match any IP-address between to


Regular expression for Decimal value

Following pattern will match any decimal digit of any size.


Regular expression for Float value

This will match any floating point value eg 1.2, 2.009 or .987 but not match 1.00 or 239


Regular expression for Hexadecimal color

This Regex pattern will match any 3 or 6 digit hexadecimal value eg: FF2 or 33CCEE


Liked It? Get Free updates in your Email

Delivered by feedburner

Leave a Reply

Your email address will not be published. Required fields are marked *