Page 1 of 1

Plain Text Position to SetCurrentSelection

Posted: Thu Feb 27, 2020 9:59 pm
by jgkoehn
I have a document with various indicators like <Gen 1:1> or <Gén 1:10> I normally can search the plain text of the document with regex.
However, I need to use this information to set a check point.

So basically I need to take the plain unicode text find the information example <Gen 1:1> then jump over to the same information in the RichViewEdit and set a checkpoint on <Gen 1:1>

I know I could use RichViewEdit.SearchTextW but I need to search for like <.*? \d+:\d+(-\d+:\d+|-\d+|)> since there are various ways these references can be entered and in unicode which SearchTextW is not a regex searcher (yet).

Any recommendations, ideas?

Re: Plain Text Position to SetCurrentSelection

Posted: Fri Feb 28, 2020 10:51 am
by Sergey Tkachenko
You can use functions from RVLinear unit.
RVGetTextRange returns text that has 1:1 correspondence to TRichView document.

And there are examples that use this function + regexp: https://www.trichview.com/forums/viewto ... f=3&t=9278