Recent

Author Topic: RegEx question  (Read 6886 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: RegEx question
« Reply #15 on: July 05, 2015, 04:41:57 am »
Byte based pos forces to an ugly workaround:

Code: [Select]
if RegexObj.Exec(S) then
    begin
       Memo1.SetFocus;
       Memo1.SelStart := UTF8Length(Copy(S, 1, RegexObj.MatchPos[0])) - 1;
       memo1.SelLength := UTF8Length( Copy(S, RegexObj.MatchPos[0], RegexObj.MatchLen[0]) );
       sleep(1000);
       while RegexObj.ExecNext do
       begin
         Memo1.SelStart := UTF8Length(Copy(S, 1, RegexObj.MatchPos[0])) - 1;
         Memo1.SelLength := UTF8Length( Copy(S, RegexObj.MatchPos[0], RegexObj.MatchLen[0]) );
         sleep(1000);
       end;
    end; 
« Last Edit: July 05, 2015, 05:59:23 am by typo »

 

TinyPortal © 2005-2018