Open oleedd opened 2 weeks ago
pcre2test:
re> /\w(?R)*\w/
data> grtgt
0: grtg
Looks correct.
Hm, I used https://regex101.com/
Got info that it uses 10.42. How is it in 10.42?
The steps are from that site as well. Is step 16 really backtrack of 3 symbols (for \w(?R)?+\w
)?
The latest release is 10.44. Anyway, I don't know how PCRE is used on that site, I suspect they emulating engines with a JavaScript implementation.
No, it is not possible. It uses a server with PCRE2.
Can you please check with 10.42?
What is step 16 for \w(?R)?+\w
with 10.44? Is this correct?
10.42:
re> /\w(?R)*\w/
data> grtgt
0: gr
It looks like there was a bug which was fixed since. You should ask that site to use the latest pcre2.
Probably this fix in 10.43:
Ok, What about my question about step 16?
What is step 16? If this is something connected with regex101 then you need to ask its managers.
PCRE2 should have a debugger or tracing which records all steps. Because it is only available for PCRE on regex101.
I wouldn't be surprised if regex101 "simply" used PCRE2_AUTO_CALLOUT
Probably yes. I am waiting for updating it to check steps and will return to close or ask. Because that backtrack of 3 symbols looks related to that fixed bug.
Running pcre2test with the -ac option (auto-callout) shows the progress of the match.
Bad that no binary version of pcre2test to try.
\w(?R)*\w
and\w(?R)?\w
for "grtgt" returns "gr" and "tg". They should find "grtg" as with "regex" for Python and JavaScript (with repeating regex many times instead of(?R)
).Additionally: why is step 16 for
\w(?R)?+\w
on the same string ("grtgt") backtrack of 3 symbols, not 2?