Problem solved. What I was forgetting is that match variables for regex's correspond to
parenthesized terms within the regex expression. In the expression I wrote I was after what the
.* matched. So it should have been written as
(.*). Once I did that I could see what the
.* was matching.
It turns out that a From: with a non-blank name without enclosing quotes was sucking up the space between the end of the name and the
< introducing the email address. The fix was to turn the
* into a "lazy *", i.e.,
.*?. So the final test expression is:
Code:
header :regex "From" "(^|,)[[:space:]]*\"?(.*?)\"?[[:space:]]*<"
and ${2} contains the name.