Luncher91 / VBScript-vscode

A vscode extension for VBScript language support
MIT License
20 stars 5 forks source link

Simplify and make greedier the method RegEx #19

Closed WorldMaker closed 1 year ago

WorldMaker commented 1 year ago

To try to fix some issues seen in #18, apply a (much) greedier args RegEx.

To help edit the RegEx, it was simplified a bit to use named groups and the \s whitespace character class.

WorldMaker commented 1 year ago

Another finding from this: if you upgrade the TS target from 'ES6' to something like 'es2018' or more recent you could use the d flag to RegEx to get direct indices for groups without needing to search the string for component parts to find indices.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/hasIndices