Regular Expressions 101

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
(?=\b(?:Что|в)\b)(.{5})
/
gmui
Positive Lookahead
(?=\b(?:Что|в)\b)
Assert that the Regex below matches
\b assert position at a word boundary: (^\w|\w$|\W\w|\w\W)
Non-capturing group
(?:Что|в)
1st Alternative
Что
Что
matches the characters Что literally (case insensitive)
2nd Alternative
в
в matches the character в with index 107410 (43216 or 20628) literally (case insensitive)
\b assert position at a word boundary: (^\w|\w$|\W\w|\w\W)
1st Capturing Group
(.{5})
.
matches any character, including unicode (except for line terminators)
{5} matches the previous token exactly 5 times
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
u modifier: unicode. Pattern strings are treated as UTF-16. Also causes escape sequences to match unicode characters
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
gmui

Test String

Regex Debugger

Please wait while your expression is being debugged...