Closed User4martin closed 1 year ago
@Alexey-T is this something you could help, please?
Maybe ... but I did not understand the text about \G. i didn't get the info on your link. and on this link- https://stackoverflow.com/questions/14897949/what-is-the-use-of-g-anchor-in-regex
first answer here https://stackoverflow.com/questions/14365969/how-the-anchor-z-and-g-works-in-ruby/14366062#14366062 is good, but I still don't understand this idea.
OK I got the idea. after some time. is it possible in engine - will think...
Martin, it is the not hard change. i hope you can make the PR. its easy to remember the end of the match after successfull Exec* call, in the new variable, and it's easy to add the \G
which handler must only compare the current-pos with that variable
let's add opcode OP_PREV_END.
I forgot the code, but here is example for COMPILING \A
and \z
'A':
ret := EmitNode(OP_BOL);
'z':
ret := EmitNode(OP_EOL);
handler of EXEC* will be near this code:
OP_BOL: //for \A
begin
if regInput <> fInputStart then
Exit;
end;
OP_EOL: //for \z
begin
// \z matches at the very end
if regInput < fInputEnd then
Exit;
end;
@User4martin Let's close?
Could \G be implemented please?
https://www.tutorialspoint.com/regular-expression-g-metacharacter-in-java
Also
ATextStartOffset
inFRegEx.Exec(ATextStartOffset)