Regex to match strings that begin with specific word and after that words seperated by slashes
问题 So i want to match all strings of the form with a regex (word1|word2|word3)/some/more/text/..unlimited parts.../more so it starts with specific word and it does not end with / examples to match: word1/ok/ready word2/hello word3/ok/ok/ok/ready What i want in the end is when i have a text with above 3 examples in it (spread around in a random text), that i receive an array with those 3 matches after doing regex.exec(text); Anybody an idea how to start? Thanks! 回答1: Something like this should