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
/
(?<!(東京|大阪))(?<!(北海道|神奈川))特許事務所
/
gm
Negative Lookbehind
(?<!(東京|大阪))
Assert that the Regex below does not match
1st Capturing Group
(東京|大阪)
1st Alternative
東京
東京
matches the characters 東京 literally (case sensitive)
2nd Alternative
大阪
大阪
matches the characters 大阪 literally (case sensitive)
Negative Lookbehind
(?<!(北海道|神奈川))
Assert that the Regex below does not match
2nd Capturing Group
(北海道|神奈川)
1st Alternative
北海道
北海道
matches the characters 北海道 literally (case sensitive)
2nd Alternative
神奈川
神奈川
matches the characters 神奈川 literally (case sensitive)
特許事務所
matches the characters 特許事務所 literally (case sensitive)
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)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
gm

Test String

Regex Debugger

Please wait while your expression is being debugged...