Tugger the SLUGger!SLUG Mailing List Archives

[chat] prob with regex


Hi all,

I am having some minor prob with a regex - I think my first .* is 
gobbling up the remainder of the expression.

I have a text file like this:
PAVEY AUASF020388
PAVEY,A AUASF02389
PAVEY,A AUASF02390       <-- just a comma then A
PAVEY,A. AUASF02391      <-- this one has a full stop

and I am matching the string PAVEY followed by anything then ONE white 
space then a string starting with AUASF that I want to remember.

s/PAVEY.* \(AUASF.*\)/AUASF00899 \1/

What I want to get out is this:
AUASF00899 AUASF020388
AUASF00899 AUASF02389
AUASF00899 AUASF02390
AUASF00899 AUASF02391

My prob is that sed script above is not replacing the PAVEY.*
I gather I cant use two '.*'s

Mike
-- 

Mike Lake
Caver, Linux enthusiast and interested in anything technical.



UTS CRICOS Provider Code:  00099F

DISCLAIMER
========================================================================
This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.
If you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly,
and with authority, states them to be the views the University of
Technology Sydney. Before opening any attachments, please check them for
viruses and defects.
========================================================================