JavaScript Regex Interactive Reference

Which strings will a regular expression match? Quickly test various regular expresions against a large list of English words.

run → any string containing the substring "run"
run|ran → any string containing the substring "run" or "ran"
^hot → any string that starts with "hot"
hot$ → any string that ends with "hot"
h.t → any string that contains "h", followed by any character, followed by "t", such as "hot" and "hat"
pro.*ing → any string that contains "pro", followed by any number of characters, followed by "ing"
(ing|ed)$ → either "ing" or "ed", followed by the end of the string
cars?$ → strings that end in "car", with an optional "s" at the end
^.......$ → Any seven character long string
^.......?.?$ → Any six, seven, or eight character long string


Loading...