List Info

Thread: optimal way to search/replace text




optimal way to search/replace text
country flaguser name
United States
2007-03-22 03:03:09

Hi Perl folks,

Below is a JUNOS configuration snippet. I am wondering what would be
the most optimal way to search/replace the text "accept" with the word
"reject" with PERL. I am just trying to get the accept replaced.

I have undefined $/

would I use something like (this is pseudo code) s/(term SSH
{..log;n)s+accept;/$1sreject;/g work well?

---- snip ---
term SSH {
from {
source-prefix-list {
PL-ADMIN-ALLOW;
}
protocol tcp;
port ssh;
}
then {
policer LIMIT-5M;
log;
accept;
---- snip ---

cheers,

Noah

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )