in reply to (joshua)Re: parsing a path
in thread parsing a path

/^\\([^\\]+)\\([^\\]+).*?(\w+\.cpp)/

And you say that might be _easier_? :)

Anyway, I think you missed a $ (or even better: \z) there... \foo\bar\baz.cpp.cpp.cpp.blah.cpp.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
(joshua) Re^3: parsing a path
by joshua (Pilgrim) on Jul 17, 2002 at 18:14 UTC
    Ah, good point. I was just building on kvale's code though.
      How about this way..
      #!/usr/bin/perl -w use strict; while (<DATA>) { my @a = split(/\\/); print "$a[1] $a[2] $a[4]\n"; } __DATA__ \nb\v5\srcccc\ans.cpp@@\main\ \nb\v5\srcccc\ans.cpp@@\main\ \nb\v5\srcccc\test.cpp@@\main\ \nb\v5\safe\test.cpp@@\main\ \nb\v5\safe\test.cpp@@\main\