in reply to regular expression help

my $test_str = 'C:\VENDOR\MICROSOFT\PLATFORMSDK\INCLUDE' ; my ( $first, $second ) = $test_str =~ m/^([^\\]+\\[^\\]+)(\\.*)$/ ; print "first: $first\nsecond: $second\n" ; # first: C:\VENDOR # second: \MICROSOFT\PLATFORMSDK\INCLUDE

_______________
D a m n D i r t y A p e
Home Node | Email

Replies are listed 'Best First'.
Re: regular expression help
by Abigail-II (Bishop) on Jun 11, 2002 at 13:19 UTC
    That would fail if the string started with a backslash, or if there's nothing between the first and the second backslash. Turning the +'s to *'s will fix that glitch.

    Abigail