Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
Created March 4, 2012 12:38
Show Gist options
  • Save adrienbrault/1972826 to your computer and use it in GitHub Desktop.
Save adrienbrault/1972826 to your computer and use it in GitHub Desktop.

Count how many variables have an underscore inside grep -E -r --include=*.php "[$][a-zA-Z\x7f-\xff]([a-zA-Z0-9\x7f-\xff]*_[a-zA-Z0-9\x7f-\xff]*)+" . | wc -l

Count how many variables have no underscore inside grep -E -r --include=*.php "[$][a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff]*" . | wc -l

The regex is from : http://php.net/manual/en/language.variables.basics.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment