Loading ...
Sorry, an error occurred while loading the content.

optimal way to search/replace text

Expand Messages
  • Noah
    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
    Message 1 of 2 , Mar 22, 2007
    • 0 Attachment
      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;/$1\sreject;/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
    Your message has been successfully submitted and would be delivered to recipients shortly.