With the Regular Expression Tester, you can enter regular expression and test quickly the way they match, substitute and transliterate text.


There is also an Explain box, that uses Jeff Pinyan's YAPE::Regex::Explain module to analyze the pattern of the regular expression. This module is included with OptiPerl's distribution.


Enter some text in the edit box and some input for processing in the left panel. Updating takes place automatically.


In the explain list box, moving through the tokens also highlights in the edit box the corresponding part of the regular expression that is explained.


Here are some examples that you can enter. After entering, type some corresponding text in the left panel to get the results.



Check for URL addresses.



Very simple check for e-mail address, not recommended.


/(\d{3,4})[- ]?(\d{4})[- ]?(\d{4})[- ]?(\d{4})/

Credit card number check



Check for IP addresses like or, consist of four bytes separated by dots.



Word at least 4 letters long, ending with an a



Signed or unsigned number, not starting with 0.



Convert all uppercase to lowercase



Check input if it is a valid U.S. telephone number.


s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg

This will unpack a URL Encoded String.


Important: You must include a starting and ending slash in the pattern you type. Entering a raw pattern does not work.


Regular Expression Tester is a program in it self! It is designed to quickly test implementations of regular expressions without endless rounds of editing-fixing-running.




Top  Previous  Next