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
/
\-\s\*cybersecurity\/information\ssecurity\:\*
/
gi
\- matches the character - with index 4510 (2D16 or 558) literally (case insensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v \u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff])
\* matches the character * with index 4210 (2A16 or 528) literally (case insensitive)
cybersecurity
matches the characters cybersecurity literally (case insensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case insensitive)
information
matches the characters information literally (case insensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v \u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff])
security
matches the characters security literally (case insensitive)
\: matches the character : with index 5810 (3A16 or 728) literally (case insensitive)
\* matches the character * with index 4210 (2A16 or 528) literally (case insensitive)
Global pattern flags
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.

Regular Expression
No Match

/
/
gi

Test String