Skip to content

Instantly share code, notes, and snippets.

@Lodo4ka
Created October 16, 2018 09:06
Show Gist options
  • Save Lodo4ka/ca72be33288f122806ffe3a8fa6bfe5b to your computer and use it in GitHub Desktop.
Save Lodo4ka/ca72be33288f122806ffe3a8fa6bfe5b to your computer and use it in GitHub Desktop.
const templates = {
keyword: /^(?:SELECT|FROM|JOIN|ON|WHERE)\b/i,
number: /^-?\d+(?:\.\d+)?/,
string: /^(?:'[^']*')+/,
name: /^[0-9A-Za-z]+/,
cmp: /^(?:<=|>=|<>|<|>|=)/, // сравнение
space: /^\s+/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment