Last active
December 14, 2015 02:49
-
-
Save phantom42/5016098 to your computer and use it in GitHub Desktop.
useful regular expressions and regex related stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- collection of useful regular expressions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- this converts camelSpaceNamedVars to split words with spaces ---> | |
#rereplace(rereplace("camelCaseString","(^[a-z])","\u\1"),"([A-Z])"," \1","all")# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relevant links