in reply to Regular expressions

Do you know what the contents of $line is when you apply your regex?

Dum Spiro Spero

Replies are listed 'Best First'.
Re^2: Regular expressions
by user786 (Sexton) on Apr 10, 2015 at 18:16 UTC

    Stopping strongSwan IPsec...

    Starting strongSwan 5.1.2 IPsec starter...

      The $ at the end of your regex says it should match up to the end of the string. If anything (including a space) is appearing after "IPsec", then the string doesn't end with "IPsec" and the match will fail. Remove the $, and it should work.

      Dum Spiro Spero
        works , thanks