Trying to match what is before /../ but after / with regular expressions
- by tim
I am trying to match what is before /../ but after / with regular expressions, but i want it to look back and stop at the first / I feel like I am close but it just looks at the first slash and then takes everything after it like... input is this:
this/is/a/./path/that/../includes/face/./stuff/../hat
and my regular expression is
#\/(.*)\.\.\/#
matching
/is/a/./path/that/../includes/face/./stuff/../
instead of just
that/../ and stuff/../
how can i adapt what i'm doing to work?