Regular Expressions 101

Save & Share

Flavor

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

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
.*?storagegroup:100\|Storage Group space used\|.*|.*?cn1=(7[6-9]|8[0-9]|9[0-9]|100).*
/
1st Alternative
.*?storagegroup:100\|Storage Group space used\|.*
.
matches any character (except for line terminators)
*? matches the previous token between zero and unlimited times, as few times as possible, expanding as needed (lazy)
storagegroup:100
matches the characters storagegroup:100 literally (case sensitive)
\| matches the character | with index 12410 (7C16 or 1748) literally (case sensitive)
Storage Group space used
matches the characters Storage Group space used literally (case sensitive)
\| matches the character | with index 12410 (7C16 or 1748) literally (case sensitive)
.
matches any character (except for line terminators)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
2nd Alternative
.*?cn1=(7[6-9]|8[0-9]|9[0-9]|100).*
.
matches any character (except for line terminators)
*? matches the previous token between zero and unlimited times, as few times as possible, expanding as needed (lazy)
cn1=
matches the characters cn1= literally (case sensitive)
1st Capturing Group
(7[6-9]|8[0-9]|9[0-9]|100)
1st Alternative
7[6-9]
7 matches the character 7 with index 5510 (3716 or 678) literally (case sensitive)
Match a single character present in the list below
[6-9]
6-9 matches a single character in the range between 6 (index 54) and 9 (index 57) (case sensitive)
2nd Alternative
8[0-9]
8 matches the character 8 with index 5610 (3816 or 708) literally (case sensitive)
Match a single character present in the list below
[0-9]
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
3rd Alternative
9[0-9]
9 matches the character 9 with index 5710 (3916 or 718) literally (case sensitive)
Match a single character present in the list below
[0-9]
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
4th Alternative
100
100
matches the characters 100 literally (case sensitive)
.
matches any character (except for line terminators)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
matches the character with index 1010 (A16 or 128) literally (case sensitive)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/

Test String