#!/usr/local/bin/perl -w use strict; use diagnostics; $|++; my $string = 'test $token1$ $lc_token1$ $token2$ $lc_token2$ end_test' +; my $w = '$'; my $token; for( qw/ token1 token2 / ) { $token = quotemeta $w . $_ . $w; $string =~ s/$token/replace1/g; $token = quotemeta $w . 'lc_' . $_ . $w; $string =~ s/$token/replace2/g; } print $string, "\n";
~Particle
In reply to Re: Do regex using hash keys to wrapped template tokens
by particle
in thread Do regex using hash keys to wrapped template tokens
by S_Shrum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |