#!/bin/perl
##################################################
# Enter a string and a regular expression.
##################################################

print "\nEnter a regular expression: ";
$re = <STDIN>;         # Get one line of input
chomp($re);            # Remove the newline/CR 


print "\nEnter a single-line string: ";
$string = <STDIN>;         # Get one line of input
chomp($string);            # Remove the newline/CR 

if ( $string =~ /($re)/ ) {
	print $1, "\n";
} else {
	print "No match\n";
}

exit;                    # End program
