Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Regex Ignore Case

by Elgon (Curate)
on Sep 24, 2002 at 23:02 UTC ( #200501=note: print w/ replies, xml ) Need Help??


in reply to Regex Ignore Case

If I've read the question right, a sensible way to do this is to use the i modifier, dependent upon a command-line parameter.

if ($case == 0) { $foo =~ s/INSERTREGEXHERE/i; } else { $foo =~ s/INSERTREGEXHERE/; }

In the case where we have stored our command line switch from @ARGV in $case as a binary flag - 0 for case-insensitive and 1 for case sensitive.

Is this what your looking for?

Elgon

UPDATE: Updated after incorrectly reading question for the first time. D'oh.

"What this book tells me is that goose-stepping morons, such as yourself, should read books instead of burning them."
       - Dr. Jones Snr, Indiana Jones and the Last Crusade


Comment on Re: Regex Ignore Case
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://200501]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2015-07-04 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls