Previous

Next


24. Perl Options - Case Insensitive Matching

  • In Perl, and in many other regex tools, you can do case insensitive matching. In Perl, it's done with the "/i" modifier:
      #!/usr/bin/perl
      $_ = "How about this for a target!";
      if (m/(THIS)/i) {
        print "$1\n";
      }
    
    gives:
      this
    

Previous

Next

Andrew Hill

For LinuxSA Meeting, 17 April 2001