Perl Monk, Perl Meditation | |
PerlMonks |
Re: Do I need to do escaping in my regex check?by choroba (Cardinal) |
on Mar 14, 2022 at 14:34 UTC ( [id://11142084]=note: print w/replies, xml ) | Need Help?? |
If you are checking one of the values is present, you don't need a regex at all.
If you want to match regexes, you need to store regexes, not strings. Use quotemeta to escape the strings.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|