We don't bite newbies here... much | |
PerlMonks |
Re: Validation of unix permissionsby eibwen (Friar) |
on May 08, 2005 at 05:35 UTC ( [id://454970]=note: print w/replies, xml ) | Need Help?? |
I want to match a comma-separated string, with zero or more items, and each item matches a particular regexp, I presume you're trying to parse valid chmod input such as ug=rwx,o=rx. While your statement allows for a number of alternative permutations, this seems the most likely. With regard to Update 2 in the OP and given the above understanding of valid input, I believe you may be looking for something akin to:
However, while this is significantly more informative, it doesn't adhere to the spirit of the OP prescription: The idea is that I'm trying to take a single regexp, and have it match multiple times with an optional separator. If you just want to detect whether the string contains an invalid permission and you don't need to inform the user of the errant setting, it is possible to use a single regex:
In Section
Seekers of Perl Wisdom
|
|