in reply to Re: Using lookaround with variables
in thread Using lookaround with variables
Strangely enough, if I put in the contents of the variables $pre and $post directly into the RegEx, then it does work. Any ideas why that might be?if( $line =~ m/(?<!\Q$pre\E)\Q$searchTerm\E(?!\Q$post\E)/ ) {print $line}; if( $line =~ m/(?<!$pre)$searchTerm(?!$post)/ ) {print $line};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using lookaround with variables
by mwunderlich (Initiate) on Dec 17, 2008 at 14:34 UTC | |
by GrandFather (Saint) on Dec 17, 2008 at 19:01 UTC | |
by mwunderlich (Initiate) on Dec 17, 2008 at 14:49 UTC |