Skip to content

Instantly share code, notes, and snippets.

@phantom42
Last active December 14, 2015 02:49
Show Gist options
  • Save phantom42/5016098 to your computer and use it in GitHub Desktop.
Save phantom42/5016098 to your computer and use it in GitHub Desktop.
useful regular expressions and regex related stuff
-- collection of useful regular expressions
<!--- this converts camelSpaceNamedVars to split words with spaces --->
#rereplace(rereplace("camelCaseString","(^[a-z])","\u\1"),"([A-Z])"," \1","all")#
// searches for select statements
select[\s\w=,<>!\(\)'\-|\.\*\d]*from\s+?WF_QUEUE_TYPE
// search for complex select statements
select[\s\w=,<>!\(\)'\-|\.\*\d]*from\s+?[\s\w=,<>!\(\)'\-|\.\*\d]*psb_users
//searches for inserts to a specific column in a specific table
//replace "update" "personnel" "eligible_epass" as necessary
// no need for a separate/additional version for table aliasing
insert\s+?into\s+?personnel\s+?[\s\w=,<>!\(\)'\-]*eligible_epass
//searches for updates to a specific column in a specific table
//replace "update" "personnel" "eligible_epass" as necessary
update\s+?personnel\s+?set[\s\w=,<>!\(\)'\-\+\*\%]*eligible_epass
// searches for updates to a specific column in a specific table with optional table alias
update\s+?personnel\s+?[\w\s]*?set[\s\w=,<>!\(\)'\-\+\*\%]*eligible_epass
@phantom42
Copy link
Author

Relevant links

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