Created
March 19, 2015 22:47
-
-
Save tom-lord/625fadf58b60babbe91b to your computer and use it in GitHub Desktop.
Examples of regex patterns that are not truly "regular"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/\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