my $regex1 = qr{(hello)}; print $1 if 'hello there!' =~ $regex1; [download]
In reply to Re: Storing Regex Patterns in Scalars by pbeckingham in thread Storing Regex Patterns in Scalars by iana