#!/usr/bin/perl -w my $x= " b c "; print for "abcd" =~ /$x/xg; # prints "bc"