Jarextor: JavaScript Regular Expression Testor
JAREXTOR
notifier #1
notifier #2
Jarextor
Example
You'll see the result.
- On the left (pattern) input, type
/a/
(finding "a" character)- On (small) right (flag) input, type
g
(global)
Other examples
- Matching URL protocol, either
http://
orhttps://
/https?:\/\//g
- The
s?
means the character s is optional, 0 or 1 repetition. - We need to escape the slash (/) with backslash. Thus the
//
becomes\/\/
- The
- Finding all "t" character and case insensitive (additional i flag):
/t/gi
- Finding all double "t"s:
/t{2}/g
- Finding all words starting with "t" and have "g" as the tail. And also case insensitive:
/t[a-z]+g/gi
[]
is the bracket to match any character within it.a-z
means match any alphabet (lowercase a through z).- The
+
meta-character is to match the preceding character (which is "[a-z]") one or more times. So it can be one character or a group of characters.
- Finding all words (with only alphabet) which don't have "t" in it and using case insensitive flag:
/\b[^t\s\W\d_]+\b/gi
\b
at the front and back are to match word boundaries.^
within the bracket is to match other characters than the ones defined inside it: t, \s, \W, \d, and character _ (underscrore).- The
\s
meta-character is whitespace (horizontal/vertical, tab, etc). - The
\W
meta-character is to match non-word. - The
\d
meta-character is to match digit (number).
/\b[a-su-z]+\b/gi
or maybe others.
Please use input characters without being wrapped in <...>
.