-
Notifications
You must be signed in to change notification settings - Fork 0
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
Multiline Regex #2
Comments
It's tricky because you want to match @}} using a non-greedy repetition operator but as soon as the engine sees @} it will stop matching to satisfy the non-greedy criteria.I expect you could address it by making the match non-greedy and using balancing group definitions (which allow the engine to match nested expressions). See http://msdn.microsoft.com/en-us/library/bs2twtah.aspx#balancing_group_definition. |
Hi Jesse, thanks for your anwser. |
Ahh, I had forgotten about this. It's a fundamental limitation of Linguist. Linguist is an Microsoft.VisualStudio.Text.Classification.IClassifier which is one of the simpler ways to extend studio, but in normal operation Linguist is called with spans of text covering one line at a time. And, as far as I can tell, there is no way for a classifier to get all of the text. |
Hello!
I'm trying to make multiline regex but it's not working. My expression is: anything between @{ and @} (but not include @{ and @})
I try:
Header2: (?<=@{)(?:.|\n|\r)*?(?=@})
or
Header2: (?<=@{)[\s\S]*?(?=@})
does not work. Do you have any idea?
Thanks
The text was updated successfully, but these errors were encountered: