You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My bad! In case someone else runs into a similar confusion: the get from a capture returns the string including the start and stop byte where the expression matched.
In the future, it is much more helpful to provide a running program. And since the regex crate is available in the playground, it's even nicer to use that. But here's a program that I believe captures what you said:
So I'm guessing the text field value here led you astray? The issue here is that the Debug impl for Match is not great (#514 is for improving it). But if we change the println! statement to
BurntSushi
changed the title
Match is not in line with other tools
Match debug impl makes it look like matches are bigger than they really are
Sep 3, 2022
What version of regex are you using?
regex = "1.6.0"
This is the text against which I'm matching:
This is the regex:
From ((.|\n)*)\n-{3}\n
That should match until the three dash separator
---
on the 7th line as it does here: https://regex101.com/r/9balQ3/1This is how I call regex in my module:
Unfortunately, regex matches the entire string down to the very list byte.
I guess I'm doing something wrong but its suprising that other tools match what I would expect.
Best regards
The text was updated successfully, but these errors were encountered: