in reply to How does this regex not match?
you want /\Q$want\E/ or substruse re 'debug'; my $orig = 'my_stuff[1]=400'; my $want = 'my_stuff[1]='; print "They Match\n" if $orig =~ /$want/; __END__ Compiling REx "my_stuff[1]=" Final program: 1: EXACT <my_stuff1=> (8) 8: END (0) anchored "my_stuff1=" at 0 (checking anchored isall) minlen 10 Guessing start of match in sv for REx "my_stuff[1]=" against "my_stuff +[1]=400" Did not find anchored substr "my_stuff1="... Match rejected by optimizer Freeing REx: "my_stuff[1]="
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How does this regex not match?
by Anonymous Monk on Feb 13, 2010 at 08:13 UTC |