Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Let's hope that / doesn't appear more than once per line. You might want to use 's|.*?/||' to bullet-proof the suggestion. Commented Jul 1, 2015 at 20:47
  • @roaima We don't have enough elements to judge; according to the example either matching greedily or lazily it's the same, because there's always one single /; if there are more than one in the part to exclude than one should match greedily like I did, otherwise one should match lazily like you suggested. Not knowing this, since the string looks pretty regular (only composed by numbers and -), I'd prefer to bullet-proof the solution against possible subdirs in the link (e.g. testing.db.com/subdir) Commented Jul 1, 2015 at 21:04
  • 1
    good argument; I'm convinced! Commented Jul 1, 2015 at 21:23