m#(.*?)#g #### my $html = "Foo: bar "; my $var = ( $html =~ m#(.*?)#g )[1]; #### Foo:</TD><TD> bar