Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Regex question once-only use of chars in a charset

by AnomalousMonk (Archbishop)
on May 16, 2011 at 13:05 UTC ( [id://905070] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >perl -wMstrict -le
    "my $s = '1a2b3c';
    ...
    matched '3c'
    matched '3c'
    matched '3c'
    
  2. or download this
    $pattern = 'Seuss';
         while (<>) {
             print if /$pattern/;
         }
    
  3. or download this
    #!/usr/bin/perl
         #    Improved simple_grep
    ...
         while (<>) {
             print if /$regexp/o;  # a good deal faster
         }