topical media & game development

talk show tell print

basic-regex-26-EscapedMetacharacters.pl / pl



  #!/usr/bin/perl -w
  use strict;
  my myTestString = "http://www.w3.org/";
  print "The test string is 'myTestString'.\n";
  print "There is a match.\n\n" if (myTestString =~ m/http:\/\/.*/);
  print "The test string hasn't changed but the pattern has.\n";
  print "Also the delimiter character is now paired '!' characters.\n";
  print "There is a match.\n\n" if (myTestString =~ m!http://!);
  print "The test string hasn't changed and the pattern is the original one.\n";
  print "Also the delimiter character is still paired '!' characters.\n";
  print "There is a match.\n\n" if (myTestString =~ m!\/!);


(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.