Simplify regular expressions

This commit is contained in:
absidue
2021-12-26 16:55:10 +01:00
parent 6c607f062f
commit 770e896cc0
4 changed files with 7 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ interface formatOptions {
s?: string;
}
// RegExp for various js functions
const var_js = '[a-zA-Z_\\$][a-zA-Z_0-9]*';
const var_js = '[a-zA-Z_\\$]\\w*';
const singlequote_js = `'[^'\\\\]*(:?\\\\[\\s\\S][^'\\\\]*)*'`;
const duoblequote_js = `"[^"\\\\]*(:?\\\\[\\s\\S][^"\\\\]*)*"`;
const quote_js = `(?:${singlequote_js}|${duoblequote_js})`;