我需要在 javascript 中使用正则表达式匹配以下类型的字符串。
E.g. /this/<one or more than one word with hyphen>/<one or more than one word with hyphen>/<one or more than one word with hyphen>/<one or more than one word with hyphen>
所以这个单一模式应该匹配这两个字符串:
1. /this/is/single-word
2. /this/is-more-than/single/word-patterns/to-match
只有斜杠(/)和开头的'this'字符串是一致的,并且只包含字母。
最佳答案
关于javascript - 匹配某种字符串的正则表达式模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22616534/