Test Regular Expressions

Enter a regular expression in the box and click the Search button. You need to include the forward slashes around the regular expression. For example, the expression /\d/ will highlight the first digit in the text. /\d/g will highlight all digits in the text. Here are a few more expressions to try:

  • /\b[r|R].*?\b/g to select all words that start with "r".
  • /<b>.*?<\/b>/g to select all bolded text.
  • uncheck innerHTML and try /<.*?>/g to select all html tags in the text.

Paste your own text in the textarea if you want. There is excellent Regular Expression reference material avaliable at http://www.regular-expressions.info/reference.html

   innerHTML    cols: rows: