in reply to Regex tester
So, now I have yours to explore with and maybe my much simpler "matcher" could possibly be of use to you :)#!usr/bin/perl $my_string = ""; $my_regx = ""; # This program tests regular expressions against a match. if ($my_string =~ /$my_regx/x) print "Matched: " . "\"" . $& . "\"" . "\n"; # print matc +h print "Before match: " . "\"" . $` . "\"" . "\n"; # print data + before match print "After match: " . "\"" . $' . "\"" . "\n"; # print data + after match }else { # do nothing } # end if print "Rockstar Programming Inc. All Rights Reserved\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex tester
by GrandFather (Saint) on Aug 24, 2008 at 21:43 UTC |