in reply to Re: Problem parsing an error msg with regex
in thread Problem parsing an error msg with regex

Thanks for the idea. I'm afraid your regex didn't work but the problem was, indeed, the spaces. I rewrote the expression as
$errmsg =~ /^ # start at beginning of string (?: # look at first group \[ # an opening square bracket [\w ]+ # followed by one or more word char/spaces ] # followed by a closing square bracket ) # end first group {3} # capture should be 1 time ( # begin second capture .+ # match anything else 1 or more times ) # close second capture
and it works as needed. Thanks again

PJ
use strict; use warnings; use diagnostics;