topical media & game development

talk show tell print

basic-regex-26-MatchingVariableSubstitution.pl / pl



  #!/usr/bin/perl -w
  use strict;
  my myTestString = "shells";
  my myPattern = "she";
  print "myPattern is found in myTestString.\n\n" if (myTestString =~ m/{myPattern}ll/);
  myTestString = "scar";
  myPattern = "car";
  print "myPattern is found in myTestString.\n\n" if (myTestString =~ m/smyPattern/);


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