Simplicalcs

    Regex tester

    Presets
    Matches will highlight here as you type…
    What your pattern means
    Quick reference
    .Any character except newline
    \dAny digit (0–9)
    \wWord character (a–z, 0–9, _)
    \sAny whitespace
    \bWord boundary
    ^Start of string / line
    $End of string / line
    [abc]Any one of: a, b, c
    [^abc]Anything except a, b, c
    [a-z]Any character in range
    +One or more
    *Zero or more
    ?Zero or one (optional)
    {3}Exactly 3 times
    {2,5}Between 2 and 5 times
    (abc)Capturing group
    (?:abc)Non-capturing group
    a|bEither a or b
    \D \W \SUppercase = the opposite
    +? *?Lazy — as few as possible
    Advertisement

    A regular expression (regex) is a pattern that describes what text you want to find or match. Enter your pattern in the regex field and it highlights every match in your sample text as you type. Switch to Replace mode to substitute matches with new text — use $1, $2 and so on to reuse anything captured by parentheses in your pattern. The replace syntax here follows JavaScript conventions, so if you copy a replacement string into Python or sed, you may need to adjust it slightly.