Hello McGaida, and welcome to the Monastery!
A side note: Did you really intend to match the | character?
Within a character class, | is just a character with no special meaning. Also, a hyphen doesn’t need to be backslashed if it’s the first or last character in the class (because Perl is smart enough to know that it doesn’t denote a range in these cases). So, assuming that you did mean to match the | character, your regular expression can be simplified from this:
/^([\w|\s|\/|\-]+)$/
to this:
/^([\w|\s\/-]+)$/
or, with different delimiters, to this:
m{^([\w|\s/-]+)$}
See perlrecharclass#Bracketed-Character-Classes.
Update: Re-ordered for improved clarity, thanks to MidLifeXis.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: taint mode
by Athanasius
in thread taint mode
by McGaida
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |