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
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
(?sx)User:\h([^\n])\n Login\-name:\h([^\n])\n (?:CaseSensitive:\h([^\n])\n)? NTSecurity:\h([^\n])\n (?:NO\n)? (?:Domain:\h([^\n])\n)? Timeout:\h([^\n])\n . Member:\h([^\n])\n
/
g
(?sx)
match the remainder of the pattern with the following effective flags: gsx
s modifier: single line. Dot matches newline characters
x modifier: extended. Spaces and text after a # in the pattern are ignored
User: matches the characters User: literally (case sensitive)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
1st Capturing Group
([^\n])
Match a single character not present in the list below
[^\n]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\n matches a line-feed (newline) character (ASCII 10)
\n matches a line-feed (newline) character (ASCII 10)
Login matches the characters Login literally (case sensitive)
\- matches the character - literally (case sensitive)
name: matches the characters name: literally (case sensitive)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
2nd Capturing Group
([^\n])
\n matches a line-feed (newline) character (ASCII 10)
Non-capturing group
(?:CaseSensitive:\h([^\n])\n)?
NTSecurity: matches the characters NTSecurity: literally (case sensitive)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
4th Capturing Group
([^\n])
\n matches a line-feed (newline) character (ASCII 10)
Non-capturing group
(?:NO\n)?
Non-capturing group
(?:Domain:\h([^\n])\n)?
Timeout: matches the characters Timeout: literally (case sensitive)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
6th Capturing Group
([^\n])
\n matches a line-feed (newline) character (ASCII 10)
.
matches any character
Member: matches the characters Member: literally (case sensitive)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
7th Capturing Group
([^\n])
\n matches a line-feed (newline) character (ASCII 10)
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
g

Test String