Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: making regex case insensitive

by hdb (Prior)
on Jul 17, 2013 at 06:33 UTC ( #1044734=note: print w/replies, xml ) Need Help??


in reply to Re: making regex case insensitive
in thread making regex case insensitive

How about doing it more directly? The obvious solution seems to be to compare against /test|Test|tEst|.../. The glob function will help to create such a pattern:

use strict; use warnings; my $pat = "test"; $pat = join "|", glob join "", map { "{".uc.",".lc."}"} split //, $pat +; print "$pat\n"; for ( qw( Test test tesT tast ) ) { print "$_\n" if /$pat/; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044734]
help
Chatterbox?
[erix]: my objection to sigs is just that they take screen space. ( Some monks would have *several* slogans underneath a 1-liner reply )
[Discipulus]: a solution would be disabiltate sig as default and let users to show them

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-06-22 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.