HiFi Regex Tester

This tool was created to help developers learn, test, and write regular expressions. It is written entirely in JavaScript, HTML, and CSS to provide live validation and match feedback on your regexs. This tool relies on JavaScript's regular expression engine which uses perl regex syntax.

//g
Options:
  • Options:
var regex = //; var input = "your input string"; if(regex.test(input)) { var match = input.match(regex); alert(match);var matches = input.match(regex); for(var match in matches) { alert(matches[match]); } } else {alert("No matches found!");}

Our Work

Shortcut Equivalent
Character
Set
Comment
\d [0-9] digit
\D [^0-9] nondigit
\s [ \t\n\r] whitespace
\S [^ \t\n\r] nonwhitespace
\w [a-zA-Z0-9] "word char"
\W [^a-zA-Z0-9] "word separator" : i.e. space or punctuation, also not EOL or BOL
[\s\S] [ALL CHARACTERS WITH NEW LINE AND SPACE]