in reply to (Solved) Extracting sometimes null string from text variable

Maybe I'm not understanding your problem, but I'd try

 /Club:\s*(.*?)\s*$/

(untested)

update

Since you're parsing multiple lines you might need a modifier like m or s.

(Can't remember which one is which)

update

never mind, see Re^3: Extracting sometimes null string from text variable

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^2: Extracting sometimes null string from text variable
by Anonymous Monk on Sep 17, 2017 at 18:47 UTC
    The \s can eat newlines, so the .* gets stuff from the next line. Try \h (horizontal space) instead.
      > Try \h (horizontal space) instead.

      Indeed a solution with \h is much easier!

      use strict; use warnings; my $case1 = "Club: Some Club Comments: "; my $case2 = "Club: Comments: "; for ($case1,$case2){ /(Club:)\h*(.*?)\h*\n/; print "<$2>\n"; }

      <Some Club> <>

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!