Swift Regex

Regular Expression
  • global
    Don't return after first match
  • multiline
    ^ and $ match the start/end of line
  • case insensitive
    Case insensitive match
  • single line
    Dot matches newline
  • ASCII only word
    Match only ASCII characters as word characters
  • ASCII only digit
    Match only ASCII characters as digits
  • ASCII only space
    Match only ASCII characters as space characters
  • ASCII only POSIX properties
    Match only ASCII characters when matching character classes

  • Matching Semantics
  • Grapheme cluster
    Match at the grapheme cluster level
  • Unicode scalar
    Match at the Unicode scalar level

  • Repetition Behavior
  • Eager
    Quantifiers match as much as possible
  • Reluctant
    Quantifiers match as little as possible
  • Possessive
    Quantifiers match as much as possible and never backtrack

  • Word Boundary
  • Unicode
    Use Unicode word boundaries
  • Simple
    Use simple ASCII word boundaries
Test String
no match
Builder DSL

Regex Debugger

Metrics
Cycle CountResetsBacktracks
000
Instructions
Flags
    100

    Match Step
    System Status
    Feedback
    Source Code
    Creator
    Donate