in reply to Help with regex and 'like' in test::more

It seems to be deciding there are special chars in the timestamp. Try this version (\Q\E is really all that changed)–

use Test::More; my $content = <<""; <tr> <td>dr_test_class</td> <td>2014-07-23 18:01:01-04</td> </tr> my $args = { class => "dr_test_class", timestamp => "2014-07-23 18:01:01-04" }; like $content, qr{<td>$args->{class}</td> .* <td>\Q$args->{timestamp}\E</td> }xis, '/report/classes dr_test_class'; done_testing();

Replies are listed 'Best First'.
Re^2: Help with regex and 'like' in test::more
by neilwatson (Priest) on Jul 23, 2014 at 18:54 UTC

    I can repeat your results. I wonder what the root cause is.

    Neil Watson
    watson-wilson.ca

      I was puzzled too, then considered the x modifier. The timestamp has a space in it. :P