topical media & game development

talk show tell print

basic-regex-26-NegatedCharacterClass.pl / pl



  #!/usr/bin/perl -w
  use strict;
  my myPattern = "[^A-D]\\d{2}";
  my myTestString = "A99 B23 C34 D45 E55";
  print "The test string is: 'myTestString'.\n";
  print "The pattern is: 'myPattern'.\n";
  if (myTestString =~ m/myPattern/)
  {
   print "There was a match: '&'.\n";
  }
  else
  {
   print "There was no match.";
  }


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.