in reply to \s matches newline in regex?
You can also use a positive lookahead in the regex to avoid replacing the newline char.
$line =~ s/Hi\s*(?=\n)//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: \s matches newline in regex?
by AnomalousMonk (Archbishop) on Jul 22, 2015 at 23:31 UTC | |
by stevieb (Canon) on Jul 22, 2015 at 23:38 UTC |