K
kj
While looking at someone else's code I came across a regular
expression that included a construct like /(foo|)/. As far as I
can tell, it should produce the same result as /(foo)?/. But the
author of the code knows a heck of a lot more Perl than I do, so
I'm wondering why she would have picked the former over the latter.
Any ideas?
Thanks!
kj
P.S. I'm aware of the fact that /(|foo)/ would produce very different
results from /(foo|)/ or /(foo)?/, but that's neither here nor
there.
expression that included a construct like /(foo|)/. As far as I
can tell, it should produce the same result as /(foo)?/. But the
author of the code knows a heck of a lot more Perl than I do, so
I'm wondering why she would have picked the former over the latter.
Any ideas?
Thanks!
kj
P.S. I'm aware of the fact that /(|foo)/ would produce very different
results from /(foo|)/ or /(foo)?/, but that's neither here nor
there.