#!/usr/bin/perl use strict; use warnings; my $test = "I am here {there} and {everywhere} but not below and above"; print "$test\n"; $_ = $test; if (/\{(.*?)\}(.*)\{(.*?)\}/) { print "Success $1 $3\n"; }