Created
January 6, 2014 03:34
-
-
Save xilin/8277815 to your computer and use it in GitHub Desktop.
Common Regex Rules
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
terminal ID : ('^')?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; | |
terminal STRING : | |
'"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') | !('\\'|'"') )* '"' | | |
"'" ( '\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') | !('\\'|"'") )* "'" | |
; | |
terminal ML_COMMENT : '/*' -> '*/'; | |
terminal SL_COMMENT : '//' !('\n'|'\r')* ('\r'? '\n')?; | |
terminal WS : (' '|'\t'|'\r'|'\n')+; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment