LinkWord
Home
Directory
Articles
Tools
Settings

Hot channels

Developer ToolsProductivity ToolsE-commerce & ShoppingSecurity ToolsAI Tools
陕ICP备2025083618号-2
← Back to tools

Regex tester

Same RegExp as the browser; global mode lists up to 5000 matches to stay responsive.

Flags

Matches (3)

  • [0] hello
  • [6] world
  • [12] 123

Runs locally; avoid pasting secrets; heavy regex may be slow.

Quick reference (JavaScript RegExp)

Character classes & escapes

SyntaxMeaning
.Any char except newline; with s, dot matches newline too
\dDigit; same as [0-9]
\DNon-digit
\wWord char (letters, digits, underscore; depends on u)
\WNon-word char
\sWhitespace (space, tab, newline, …)
\SNon-whitespace
\t / \n / \rTab / line feed / carriage return
\\Literal backslash
\.Escaped dot, matches a literal .
[abc]Character class: one of a, b, c
[^a]Negated class: anything but a
[a-z]Range: lowercase letters
\u{1F600}Unicode code point (with u flag)

Quantifiers

SyntaxMeaning
*0 or more (greedy)
+1 or more (greedy)
?0 or 1
{n}Exactly n times
{n,}At least n times
{n,m}Between n and m times
*?Non-greedy *
+?Non-greedy +
??Non-greedy ?

Anchors

SyntaxMeaning
^Start; with m, also start of each line
$End; with m, also end of each line
\bWord boundary
\BNot a word boundary
^ / $No \A / \Z in JS; use ^, $, and m for string vs line

Grouping & assertions

SyntaxMeaning
|Alternation (lowest precedence)
(…)Capturing group → $1, $2, …
(?:…)Non-capturing group
(?<name>…)Named capture group
(?=…)Positive lookahead
(?!…)Negative lookahead
(?<=…)Positive lookbehind
(?<!…)Negative lookbehind

Flags (same as toggles above)

SyntaxMeaning
gGlobal: find all matches / multiple exec
iCase-insensitive
mMultiline ^ and $
sDotAll: . matches newline
uUnicode mode for code points and property escapes
ySticky: match only from lastIndex

Lookbehind (?<=) / (?<!) needs ES2018+. With u, \w and \b align better with Unicode.

Back to home