Skip to content

Instantly share code, notes, and snippets.

@tom-lord
Created March 19, 2015 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tom-lord/625fadf58b60babbe91b to your computer and use it in GitHub Desktop.
Save tom-lord/625fadf58b60babbe91b to your computer and use it in GitHub Desktop.
Examples of regex patterns that are not truly "regular"
/\bword\b/ # How does "\b" know whether it lies on a word boundary?
/line1\n^line2/ # How does "^" know whether it lies at the start of a line?
/irregular (?=expression)/ # Or in general, how can any "look-ahead"/"look-behind" be regular?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment