Skip to content

Instantly share code, notes, and snippets.

@zeroasterisk
Created October 27, 2010 17:37
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 zeroasterisk/649546 to your computer and use it in GitHub Desktop.
Save zeroasterisk/649546 to your computer and use it in GitHub Desktop.
Find and Replace to add spaces after commas and before&after => within PHP
find:
(\"[^,\n\"\'\(]+\"|\'[^,\n\"\'\(]+\'|\$[a-zA-Z0-9\_\-\>]+|[0-9]+|\'\'|\"\"|null|false|true|\)|\]|\/[a-z]*),([a-zA-Z0-9\'\"\$\)\(\[])
replace:
$1, $2
find:
(\"[^,\n\"\'\(]+\"|\'[^,\n\"\'\(]+\'|\$[a-zA-Z0-9\_\-\>]+|[0-9]+|\'\'|\"\"|null|false|true|\)|\]|\/[a-z]*)=>([a-zA-Z0-9\'\"\$\)\(\[])
replace:
$1 => $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment