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
/
\*\*(?=[\w|\s])
/
g
\* matches the character * with index 4210 (2A16 or 528) literally (case sensitive)
\* matches the character * with index 4210 (2A16 or 528) literally (case sensitive)
Positive Lookahead
(?=[\w|\s])
Assert that the Regex below matches
Match a single character present in the list below
[\w|\s]
\w matches any word character (equivalent to [a-zA-Z0-9_])
| matches the character | with index 12410 (7C16 or 1748) literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v \u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff])
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/
g

Test String

Substitution

Processing...

Code Generator

Generated Code

Loading code sample...
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report.
For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions