Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regexes can't match the start of the line #99

Closed
Timmmm opened this issue Aug 30, 2022 · 3 comments
Closed

Regexes can't match the start of the line #99

Timmmm opened this issue Aug 30, 2022 · 3 comments

Comments

@Timmmm
Copy link

Timmmm commented Aug 30, 2022

Presumably the settings in this comment worked once, but they no longer do. I tried both (^#.*) and ^(#.*) and neither ever match. (#.*) works (but obviously doesn't behave like I want.

@fabiospampinato
Copy link
Owner

fabiospampinato commented Nov 15, 2022

I don't think that regex was designed to match the start of a line.

You need to set the "multiline" flag explicitly for "^" to match the start of a line and not the start of a file.

  "highlight.regexFlags": "gmi"
  // OR
  "regexFlags": "gmi"

@ndjhartman
Copy link

Just some feedback perhaps this should be added to the warnings section on the mainpage, spent some time trying to get my match to work thinking it was an issue with the escaping. Thanks for the extension, very useful!

@fabiospampinato
Copy link
Owner

Good idea, just added 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants