Simple patterns can be reversed: /foo/ can be reversed to /oof/.
Many more complex patterns can be reversed, though it isn't always obvious whether they'd match in exactly the same way: consider for example:
in which you might expect the parens to catch "ississip" (ie start the match at the earliest available position) rather than "ip"."mississippi" ~~ /p<after (i.*?p)>/; # reverse to /(p.*?i)/ ?? # or maybe /(p.*i)/ ??
However other examples cannot be reversed at all: in general, this might include anything that involves code assertions. Precisely what constitutes a reversible pattern has not yet been fully characterised, and to some extent it will depend on what we decide are the invariants that must be preserved as in the example above.
Hugo
In reply to Re: What does it mean that a "pattern cannot be reversed?"
by hv
in thread What does it mean that a "pattern cannot be reversed?"
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |