Tugger the SLUGger!SLUG Mailing List Archives

Re: [chat] prob with regex


Michael Lake:

> 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

$ cat mike
PAVEY AUASF020388
PAVEY,A AUASF02389
PAVEY,A AUASF02390
PAVEY,A. AUASF02391

$ sed "s/PAVEY.* \(AUASF.*\)/AUASF00899 \1/" < mike
AUASF00899 AUASF020388
AUASF00899 AUASF02389
AUASF00899 AUASF02390
AUASF00899 AUASF02391

Are you using GNU sed?

- ii

-- 
  Penguinillas Pack GNUzis