Are you sure that pattern is what you want? It demands that the string be followed by any amount of whitespace (including none!), followed by at least one character of non-whitespace which will be capture. Here are some things it will match:
$text = "whatever_you_already_havefoobar\n"; # $1 eq "foobar"
$text = "whatever_you_already_have foo\nbar"; # $1 eq "foo"
$text = "whatever_you_already_have\nfoobar"; # $1 eq "foobar"
$text = "whatever_you_already_have\nfoo bar"; # $1 eq "foo"
You probably meant something more along the lines of
/whatever_you_already_have.*\n(.*)/
Or if you want to do it using /s for other reasons,
/whatever_you_already_have[^\n]*\n([^\n]*)/s
Makeshifts last the longest.
|