Skip to content

Instantly share code, notes, and snippets.

@y2k-shubham
Created October 16, 2019 04:37
Show Gist options
  • Save y2k-shubham/2b4165ab358eedbaa296e3c5992e4935 to your computer and use it in GitHub Desktop.
Save y2k-shubham/2b4165ab358eedbaa296e3c5992e4935 to your computer and use it in GitHub Desktop.
SQL-query-keyword-capitalization
Find regex: `(?<!\w)(insert|is|into|with|as|select|from|where|between|and|or|distinct|case|when|then|else|end|on|null|not|inner|outer|full|join|left|right|group|by|order|limit|in)(?!\w)`
Replace regex: `\U$1\E`
@y2k-shubham
Copy link
Author

given a SQL query, above replacement will capitalize it's keywords like 'select' -> SELECT', 'group by' -> GROUP BY' etc.

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