should be/(?<!$pre)$searchTerm?!$post/
Actually, if $pre, $searchTerm and $post are text rather than regexp patterns, it should be/(?<!$pre)$searchTerm(?!$post)/
/(?<!\Q$pre\E)\Q$searchTerm\E(?!\Q$post\E)/
In reply to Re: Using lookaround with variables
by ikegami
in thread Using lookaround with variables
by mwunderlich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |