Skip to content

What is the Lua patterns for this? #419

Closed Answered by SpartanJ
Curculigo asked this question in Q&A
Discussion options

You must be logged in to vote

RegEx is essentially correct, all vscode regex should work on ecode. But this particular one does something I wouldn't do on ecode because it's not needed and does not match how the parser works, but i think it's the only rule won't be equal on ecode: new lines don't need to be evaluated as part of the regex, alsp the (?x) is a flag and it's not needed for that specific regex, and the last ? is redundant, so in short:
^\\s*(@[A-Za-z_]\\w*)\\s*(:\\s*\\w+\\s*)$
would do the job in ecode (removed all the unnecessary stuff), although is a very simple regex that can be represented with lua patterns which are faster:
^%s*(@[%a_]%w*)%s*(%:%s*%w+%s*)$

RegEx and LuaPattern this time are essentiall…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Curculigo
Comment options

Answer selected by Curculigo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants