in reply to qr// and user provided regex patterns...
An alternate approach that I usually employ is to provide another command-line option for a case-sensitive match.
my $pattern = ($options{i}) ? qr/$options{c}/i : qr/$options{c}/;
The following does a case-sensitive match:
regexTester -c 'Bill Clinton'
The following does a case-insensitive match:
regexTester -i -c 'Bill Clinton'
See Finding commands in Unix PATH for a complete example with POD instructions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: qr// and user provided regex patterns...
by misterMatt (Novice) on Jul 31, 2009 at 06:54 UTC | |
by Anonymous Monk on Jul 31, 2009 at 07:06 UTC | |
by ikegami (Patriarch) on Jul 31, 2009 at 13:45 UTC |