#!/usr/bin/perl
use strict;
use warnings;
#################
#
# Test regular expressions.
#
#################

sub prompt {
  my $message = shift;
  print $message . " : ";
  chomp(my $answer = <>);
  return $answer;
}

while (1){
  my $string = prompt("string");
  my $regex = prompt("regex");
  print  " " . ($string =~ /$regex/ ? "Yes" : "No" ) . ".\n";
}
