AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Resources - RegEx Tester

Regular Expression Tester



Enter your regular expression :



Or choose one from the list :


Enter text to search against in the textarea below :

New Test

What are Regular Expression?
Regular expressions are a series of special characters that looks like your cat has walked over your keyboard.
For example /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/

What the above does is match email adresses from a given string (block of text) using a set pattern.

Regular Expressions can be difficult to learn but it's worth the effort. Using regular expressions can save you loads of time if you need to do a lot of text manipulation.

Use the above form to test your regular expressions. Either enter your own into the space provided or select a pre defined one from the list. Enter the thect you want to search into the textarea and click on the TestExpression button.

Some Special Characters and their meaning
^ Start of a line
$ End of a line
. Any character except for newline character (if used without parameter " /.../s")
[ ... ]

Match any characters between the []

[^ ... ] Doesn't Match any of the characters between the []
\#

Escape spaecial characters to use as literal for example, $ is a special character if you want to match a $ in your text escape it with a backslash \$

\b Word boundary -
  • /\bit/ would match itch but not stitch
  • /it\b/ would match sit but not site
\B Non word Boundary -
  • /\Bit\B/ will match site but not sit
  • /\Bit/ will match site and sit but not itch
\n Match linefeed or new line character
\r Match Carriage Return
\t Match Tabs
\s A whitespace character (tab/space /cr/lf)
\S Not a whitespace character
\w Match a word character - letters digits and underscore
\W A non-word character - including spaces
\d A digit
\D Not a digit

Updated 13 Sep 2004




Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]