in reply to Re: regexp need a match characters and spaces
in thread regexp need a match characters and spaces
That is, simply make sure you don't include "\n" among the kinds of white-space that can follow "b" in order to yield a match.$a = " a 10 b a2 s2 c 30"; ( $c ) = $a =~ /^b[ \t]+(.*)/m; print "$c\n";
(BTW, you want everything on the line that starts with "b", and the "m" modifier on the regex does not affect the behavior of "." -- it still will not match "\n", so the question mark and dollar sign in the OP version -- (.*?)$ -- are redundant here.)
|
|---|