Just fiddling with regex's because I see them in the digests everyday, and
I though the best way to learn these is to try them.
Currently sliding backwards down the learning curve...
Just want to parse an email header containing addresses in format:
>> Joe Frderick Blogss <[EMAIL PROTECTED]>
Thanks for the regex, but that wasn't quite what I needed, it's functional
but I still don't know how it works !
$line =~ s/^\s*(.+?)\s<(.+?)>,*/$1, $2/;
OK so what does the $1 and $2 mean , what are they pointing to and how do I
manipulate them...
and what does the $& thingy do as well.
Much
$line =~ s/^\s*(.+?)\s<(.+?)>,/$1, $2/;
Michael Carmody wrote:
>
> Just fiddling with regex's because I see them in the digests everyday, and
> I though the best way to learn these is to try them.
> Currently sliding backwards down the learning curve...
>
> Just want to parse an email header co
Okay, the regexp:
$line =~ s/^\s*(.+?)\s<(.+?)>,*/$1, $2/;
Basically, $1 holds what is in the first set of (), and $2 holds what is
matched in the second set of (). In otherwords, if you had the line:
bob
$1 would hold "bob", and $2 would hold "something in here". So, this
regexp would rep