in reply to Problem parsing an error msg with regex
\w+ doesn't match spaces. Use [^\]]+ instead:
$errmsg =~ /^((?:\[[^\]]+\]){3})(.*)/; or
$errmsg =~ s/^(?:\[[^\]]+\]){3}//;
Update: The directions were correct, but the code was missing a set of parens.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem parsing an error msg with regex
by periapt (Hermit) on Oct 07, 2004 at 14:19 UTC |