PavelTorgashov / FastColoredTextBox

Fast Colored TextBox for Syntax Highlighting. The text editor component for .NET.
Other
1.21k stars 463 forks source link

Issue with GetRanges() and GetRangesByLines() #194

Closed nongcaro closed 4 years ago

nongcaro commented 4 years ago

Okay, so GetRanges() treats the whole text as one line. So you can't search using ^word$, because that won't work, since it sees, for an example:

word
word
word

As one line. I tried with the option Multiline and also Singeline, but nothing worked. However, with GetRangesByLines(), this works, because it treats them like lines.

Okay, but with GetRanges(), you can search using newlines, for an example word\r\nword and it will find what you're looking for, which is good, it's what I need. But GetRangesByLines() doesn't do this (even with the Regex options, tried it).

So they both have something I'm looking for, I want a combination of both, how do I do this? I usually use Regex101 and Regex Hero for all my testing, and they all work perfectly with my regular expressions, except this library.

I need it to work like Regex Hero, both with newlines and $^, anyone could help?

nongcaro commented 4 years ago

It seems like Regex works with \n but not with \r\n.