Friday, January 09, 2009

Some common regexs

set COMMENT {/\*[^*]*\*+([^/*][^*]*\*+)*/} # regex to match a comment
set COMMENT2 "//\[^\n]*" # regex to match a C++// comment
set DOUBLE {"(\\.|[^"\\])*"} # regex to match doublequoted string
set SINGLE {'(\\.|[^'\\])*'} # regex to match singlequoted constant

No comments: