#!/usr/bin/perl use strict; use warnings; my $searchstring = 'Price: \$([0-9]+\.[0-9]+)'; $_ = 'This is a test. Price: $1.30'; if( /$searchstring/ ) { print "match\n"; } __END__ match #### my $searchString = qr/Price: \$([0-9]+\.[0-9]+)/;