in reply to A poor bloke and his regex...

I think this should work for you (WARNING: I did it really quickly):
#!/usr/bin/perl -w use strict; while (<DATA>) { s/^\/[\S]+\s//; print "$_\n"; } __DATA__ INVALID ORDER-NO 4546090 INVALID ORDER-NO 4546090 INVALID ORDER-NO 4546090 INVALID ORDER-NO 4546090 INVALID ORDER-NO 4546090 /base-dir/dir/foo.txt INVALID ORDER-NO 4546090 INVALID ORDER-NO 4546090 INVALID ORDER-NO 4546090
This assumes your error msg will never start with /.

UPDATE: I knew I did this too fast:
  • I had a useless character class
  • didn't chomp THX tadman

  • so rewritten:
    while (<DATA>) { chomp; s/^\/\S+\s//; print "$_\n"; }


    grep
    grep> grep clue /home/users/*

    Replies are listed 'Best First'.
    Re: Re: A poor bloke and his regex...
    by vek (Prior) on Mar 01, 2002 at 18:15 UTC
      Cheers grep, works like a charm!

      UPDATE: Thanks to all who replied, all good suggestions BTW.