Reply To: regular expression help

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf regular expression help Reply To: regular expression help

#58369
Jamin Gray
Participant

    If you want to do this using a regular expression, I would suggest something like this:

    Code:


    regsub -all {ZZ00.(.*)} $var1 {1} var2

    where your original string is in $var1 and the result (everything after the period) will be put in $var2.

    The regex to match the pattern is ZZ00.(.*) which says look for ZZ00 followed by a period and then capture anything after the period.  Then you are taking that saved capture 1 and placing it in $var2.

    -jamin