2 remaining problems: The input file:


version "4.0I0 tlim";
system {
    host-name steve-1;
    domain-search  mydomain.com mydomain.net ;
    time-zone Here/There;
    authentication-order  plus password ;
    root-authentication {
#        encrypted-password "CENSORED"; # CENSORED-SECRET-DATA
    }
    name-server {
        0.0.0.0;
        1.1.1.1;
    }
    plus-server {
        3.3.3.3 {
#            secret  "CENSORED"; # CENSORED-SECRET-DATA
            timeout 20;
        }
        4.4.4.4 {
#            secret  "CENSORED"; # CENSORED-SECRET-DATA
            timeout 20;
        }
    }
    login {
        class super-user {
            idle-timeout 120;
            permissions all;
        }
        user local {
            uid 5555;
            class super-user;
            authentication {
#                encrypted-password "CENSORED"; # CENSORED-SECRET-DATA
            }
        }
        user remote {
            uid 2004;
            class super-user;
        }
    }
    services {
        telnet;
    }
    syslog {
        archive size 10000000 files 10;
        user * {
            any emergency;
        }
        host 6.6.6.6 {
            authorization any;
            kernel any;
            user any;
            change-log any;
            facility-override local7;
        }
        host 7.7.7.7 {
            authorization any;
            kernel any;
            user any;
            change-log any;
            facility-override local7;
 


yields:

version "4.0I0 tlim";
system host-name 1steve-1;
system domain-search  mydomain.com mydomain.net ;
system time-zone Here/There;
system authentication-order  plus password ;
system root-authentication #        encrypted-password "CENSORED"; # CENSORED-SECRET-DATA
system name-server 0.0.0.0;
system name-server 1.1.1.1;
system plus-server 3.3.3.3 #            secret  "CENSORED"; # CENSORED-SECRET-DATA
system plus-server 3.3.3.3 timeout 20;
system plus-server 4.4.4.4 #            secret  "CENSORED"; # CENSORED-SECRET-DATA
system plus-server 4.4.4.4 timeout 20;
system login class super-user {
system login idle-timeout 120;
system login permissions all;
system user local {
system uid 5555;
system class super-user;
system authentication #                encrypted-password "CENSORED"; # CENSORED-SECRET-DATA
user remote {
uid 2004;
class super-user;
services telnet;
syslog archive size 10000000 files 10;
syslog user * {
syslog any emergency;
host 6.6.6.6 {
authorization any;
kernel any;
user any;
change-log any;
facility-override local7;
host 7.7.7.7 {
authorization any;
kernel any;
user any;
change-log any;
facility-override local7;


The remaining problems: 1. deleting whitespace eg:

system authentication #                encrypted-password "CENSORED"; # CENSORED-SECRET-DATA

to:

system authentication # encrypted-password "CENSORED"; # CENSORED-SECRET-DATA

problem 2:

...........snip.......

system authentication #                encrypted-password "CENSORED"; # CENSORED-SECRET-DATA
user remote {
uid 2004;
...etc.

I lose the prepending strings here, and I don't know why. I suspect that it has to do with multiple "}"'s Thanks for all your help thus far......

In reply to 2 remaining problems (regex) by Limo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.