Yes, see perlre. If one expression is too difficult, why not use two?
If you really need to write it in one expression, use a group and quantify that:
m!^/usr(?:/[^/]+)?/bin!;
In reply to Re^3: dir match, dir may or may not appear
by Corion
in thread dir match, dir may or may not appear
by hellosarathy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |