#!/usr/bin/perl
# imageregextest.plx
# To remove an image tag: /
]+)>/ig or /
/ig
# To remove anchor tag: /<[aA]\s+[hH][rR][eE][fF]=[^>]*>/
# Preamble: This program asks for a regular expression to be input, to test for
# a match to an HTML image tag.
use warnings;
use diagnostics;
use strict;
$_ = '
';
print "Enter a regular expression: ";
my $pattern = ;
chomp($pattern);
if(/$pattern/)
{
print "The text matches the pattern $pattern.\n";
}
else
{
print "'$pattern' was not found\n";
}