W
wana
I was getting carried away answering myself in another thread so I thought I
should purify my actual problem:
I am allowing a user to enter a perldoc name and I will run 'perldoc $name'
for them.
What regex will match all perldoc names but not allow for a command to be
slipped into the name.
for example, here is my latest:
/^[a-zA-Z1-9\:]+$/
if you allowed just anything:
/.*/
a user could enter 'perlref | rm -r ./*' or something like that.
previous attempts:
/^[a-z]+$/
seemed perfect but left out perlfaq1-9
/^[a-z1-9]+$/
left out CGI and other ones with caps.
Is there a rule for all current and future perldoc names? I mean, they
can't possible have a | or a > in their name or even a space in the middle,
right?
wana
should purify my actual problem:
I am allowing a user to enter a perldoc name and I will run 'perldoc $name'
for them.
What regex will match all perldoc names but not allow for a command to be
slipped into the name.
for example, here is my latest:
/^[a-zA-Z1-9\:]+$/
if you allowed just anything:
/.*/
a user could enter 'perlref | rm -r ./*' or something like that.
previous attempts:
/^[a-z]+$/
seemed perfect but left out perlfaq1-9
/^[a-z1-9]+$/
left out CGI and other ones with caps.
Is there a rule for all current and future perldoc names? I mean, they
can't possible have a | or a > in their name or even a space in the middle,
right?
wana