orangedog1984 — 2011-08-25T16:20:59-04:00 — #1
I am trying to match the portion of this string after the last forward slash:
so, in this case I would want to match 'test_page_01.php'.
I've tried using so many patterns but they all match the whole thing, not the part after the last forward slash, even if I use lazy quantifiers.
I use this one
That should match everything between the last forward slash and the end of the string, because it's the lazy quantifier, but it doesn't. Can someone please explain why that pattern doesn't work. Thanks.
salathe — 2011-08-25T16:46:02-04:00 — #2
There's a function for that.
If you really want a regex, ask for the series of non-slash characters at the end of the string.
orangedog1984 — 2011-08-26T10:27:36-04:00 — #3
Thanks very much, basename() is the perfect solution.