Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
Created October 23, 2008 20:12
Show Gist options
  • Select an option

  • Save subtleGradient/19189 to your computer and use it in GitHub Desktop.

Select an option

Save subtleGradient/19189 to your computer and use it in GitHub Desktop.
(?x-m)^
# Yes *+ Open ( Blank |Comments | (No Paren | String) | String | (Nested Parens ) )*+
(?> \g<yesS>*+ \[ (?<yesS> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noS>[^\[\]''"/]) | (?<str> ''(\\''|[^''])*+'' | "(\\"|[^"])*+" | /(\\/|[^/])*+/) | (?<squar> \[ \g<yesS>*+ \] ) )*+
| \g<yesR>*+ \( (?<yesR> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noR>[^\(\)''"/]) | \g<str> | (?<round> \( \g<yesR>*+ \) ) )*+
| \g<yesC>*+ \{ (?<yesC> (?!.) |//.*+|/\*((?!\*/).)++(\*/|$)|(^)((?!/\*).)*(\*/)| (?<noC>[^\{\}''"/]) | \g<str> | (?<curly> \{ \g<yesC>*+ \} ) )*+
)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment