in reply to Re: Regex - one and only one / at beginning and end of file path
in thread Regex - one and only one / at beginning and end of file path

^/*(.*[^/])/*$
That will only match if the path ends in a slash. Duh! I think I checked my brain at the door. Sigh..

Makeshifts last the longest.

  • Comment on Re^2: Regex - one and only one / at beginning and end of file path
  • Download Code

Replies are listed 'Best First'.
Re: Regex - one and only one / at beginning and end of file path
by Abigail-II (Bishop) on Dec 15, 2003 at 09:28 UTC
    $ perl -wle '"foo/bar" =~ m!^/*(.*[^/])/*$! and print "Aristotle i +s wrong."' Aristotle is wrong.

    Abigail