|
|
Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis. |
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).
|
|
Thread Tools |
I think your real problem is that the regex pattern .* is greedy, in that it will try to match the longest string of text possible. Given the text:
/play/Classical/Chopin_-_Fantasie_Impromptu/ /play/(.*)/? will always include the trailing slash in the match because it still satisfies the pattern and is longer than a match without the slash. The solution is to use a non-greedy qualifier such as /play/(.*?)/? instead. That will try to match as little text as possible while satisfying the pattern. Jam it back in, in the dark.
---
|