View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-19-2022 , 13:38   Re: Regex MatchOffset - Does it work right ?
Reply With Quote #4

Yeah, but, in such case it should be rextest.MatchOffset(a) in your code, because MatchOffset is accepting index of match, not index of capture.
Index of capture can be used with GetSubString (argument str_id) as according to docs.
One match can contain several captures. The capture is a part enclosed in parentheses. If you would have several enclosed parts in expression e.g. "(STEAM_)(\\d:\\d:\\d+)", so you'll have several captures in each match.
Anyway, it doesn't change that the result offset is a bugged value. It should point to the start of a string index where match was found.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 04-19-2022 at 13:41.
Dragokas is offline