Reputation: 419
I'm trying to rewrite a URL such as
to
But leave
untouched.
I'm fairly certain this shoudl be fairly easy to accomplish but I'm not so savy with Regular Expressions and the last couple of hours I've spent digging through googled regex guides has left me with no solution thus far.
[-a-zA-Z0-9_]*/.+
suffices for giving me the opposite of what I want (matching "someword/anotherword/" but not just "someword/"). I need the opposite, to match just "someword/" but not "someword/anotherword/"
Upvotes: 0
Views: 68
Reputation: 576
try this:
[-a-zA-Z0-9_]*/$
simple and fast tutorial:
.+ means any chracter one or more times
.* any character 0 or more times
$ is end of line
Upvotes: 1