Code: Select all
ExamineRegularExpression(#RegularExpression, String$[, Position])
; Or
SetRegularExpressionPosition(#RegularExpression, String$, Position) ; for ExamineRegularExpression(), ReplaceRegularExpression(), etc
Code: Select all
ExamineRegularExpression(#RegularExpression, String$[, Position])
; Or
SetRegularExpressionPosition(#RegularExpression, String$, Position) ; for ExamineRegularExpression(), ReplaceRegularExpression(), etc
Code: Select all
RegularExpressionMatchPosition()
I need to use the position, not know it. I need to use it to speed up the search. Let's say I have 1000 files of 1 MB each and I use a complex regular expression with forward and backward viewing, while if I need to find some text at the end of the file, then I would not have to view 1000 MB of data, but only 100 MB or 1 MB if I do a one-step viewing, no more than one element in front. That is, waiting for 1 second or 1000 seconds=16 minutes, I hope it matters to you.highend wrote: Sun Dec 31, 2023 1:13 am There isJust store these positions during the loop if you want to access them (later)?Code: Select all
RegularExpressionMatchPosition()
Good suggestion.AZJIO wrote: Sat Dec 30, 2023 11:43 pmCode: Select all
ExamineRegularExpression(#RegularExpression, String$[, Position])
Code: Select all
^(?:.{10000}).+?(<regex>)
Look at the "offset" parameter in the StringRegExp function.highend wrote: Sun Dec 31, 2023 8:55 am Afaik not possible. That's internal data of the regex engine, you can't start / resume a regex search from a different position.
What you can do is: If you got the position from the first match, split the string at that pos (-1) and start the search on the second part of the split
I know these methods.