Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Save & Share

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

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python 2.7
  • Golang (RE2)

Function

  • Match
  • Substitution
  • List
  • Unit Tests
%
(?!((<.*?)|((<a.*?))))(suchwort)(?!(([^<>]*?)>)|([^>]*?(</a>)))
%
sgi
Negative Lookahead
(?!((<.*?)|((<a.*?))))
Assert that the Regex below does not match
1st Capturing Group
((<.*?)|((<a.*?)))
1st Alternative
(<.*?)
2nd Capturing Group
(<.*?)
< matches the character < literally (case insensitive)
.*?
matches any character
*? Quantifier — Matches between zero and unlimited times, as few times as possible, expanding as needed (lazy)
2nd Alternative
((<a.*?))
3rd Capturing Group
((<a.*?))
4th Capturing Group
(<a.*?)
<a matches the characters <a literally (case insensitive)
.*?
matches any character
5th Capturing Group
(suchwort)
suchwort matches the characters suchwort literally (case insensitive)
Negative Lookahead
(?!(([^<>]*?)>)|([^>]*?(</a>)))
Assert that the Regex below does not match
1st Alternative
(([^<>]*?)>)
6th Capturing Group
(([^<>]*?)>)
7th Capturing Group
([^<>]*?)
Match a single character not present in the list below
[^<>]*?
*? Quantifier — Matches between zero and unlimited times, as few times as possible, expanding as needed (lazy)
<> matches a single character in the list <> (case insensitive)
> matches the character > literally (case insensitive)
2nd Alternative
([^>]*?(</a>))
8th Capturing Group
([^>]*?(</a>))
Match a single character not present in the list below
[^>]*?
*? Quantifier — Matches between zero and unlimited times, as few times as possible, expanding as needed (lazy)
> matches the character > literally (case insensitive)
9th Capturing Group
(</a>)
</a> matches the characters </a> literally (case insensitive)
Global pattern flags
s modifier: single line. Dot matches newline characters
g modifier: global. All matches (don't return after first match)
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

%
%
sgi

Test String