Skip to content

Instantly share code, notes, and snippets.

@dmajda
Created June 28, 2012 09:07
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 dmajda/3010091 to your computer and use it in GitHub Desktop.
Save dmajda/3010091 to your computer and use it in GitHub Desktop.
Regexp parsing proposal for Machete (snippet)
[
:REGEXP,
/^
\/
(
\\ # escape
(
[\\"ntrfvaebs] # one-character escape
|
[0-7]{1,3} # octal number escape
|
x[0-9a-fA-F]{1,2} # hexadecimal number escape
)
|
[^\/] # regular character
)*
\/
/x
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment