With the following string:
The usual work-around is to match the things before (this consumes characters) and capture the desired substring in a group afterwards:
JS code, this would be:
var str = "foo/:something/bar/:somethingelse"; var re = /\/:([^/]+)/g; var matches = str.match(re);
Thanks to @Wiktor for the clarification of nomenclature.