No. And no.
The OP did provide enough information. He may be "guilty" of abusing the regex for a task typically solved otherwise, but the problem is understood and so is the desire for it. Variations on the theme have been posted before: "can I determine the point of matching failure? The longest tentative match?"
I'm not intimately familiar with the guts of rx matching, but here's how I reckon this: the rx engine does its best to try to avoid any sort of delay or inefficiency in backtracking. It does not remember where it fails. So this feature is something that PCRE does support and perl does not.
One "solution" that might work for the OP, is to rewrite the pattern and inject
(?(?{pos==length})(*ACCEPT))before every \\, but that's neither generic nor tidy.
In reply to Re^2: Regex partial/leading match
by Anonymous Monk
in thread Regex partial/leading match
by raymorris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |