regex self taught, not fun...

2001-07-17 Thread Michael Carmody
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]>

regex self taught, not fun...

2001-07-18 Thread Michael Carmody
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

Re: regex self taught, not fun...

2001-07-18 Thread David Wood
$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

RE: regex self taught, not fun...

2001-07-18 Thread Brian
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