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 <something in here>
$1 would hold "bob", and $2 would hold "something in here". So, this
regexp would replace the entire line with "bob, something in here".
I would suggest picking up a copy of "Mastering Regular Expressions".
It's an awesome book for learning regexps. :o)
Brian Johnson
Partner/Systems Administrator/Programmer
Source1Hosting.tv, LLC (www.source1hosting.tv)
Source1Results.com, LLC (www.source1results.com)
I may be insane, but remember - The only
difference between an insane man and a
genius is his jacket.
>
> 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 appreciate and explanation and if someone can point me
> to the part in
> perldoc where this is explained I would be grateful, having
> read the regex,
> and s/// entries, and still none the wiser for the above.
>
>
> Michael Carmody
> MDU, Public Health Lab
> Dept. of Microbiology and Immunology
> The University of Melbourne, Parkville
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]