-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Sometimes, for the sake of formatting my code to look nice, I like to add a new line immediately after the template literal tick. For example:
const test = await client.query(`
select * from test
`)
Obviously this simple example does not need the new line (or I could have escaped before the tick), but larger queries often do to maintain alignment. No matter what I try, I cannot get the lookahead to match the whitespace because \s
results in a JSCustom error "invalid escape character" .
I have tried "[\n\t ]*select"
which will happily match spaces and tabs, but not the new line.
Also, your example in the config settings select\b
does not match a template string select 1 from dual
.
I find it strange that some regex works, but others don't. Personally, whitespace matching would solve my problem, but it seems sensible to parse all valid regex.