我想匹配一些相同的模式,并包括那些只有3个正斜杠的网址。例如:
通行证:
abc.org/top/1010/red-shirt-plus
abc.org/top/1567/gree-0109失败:
abc.org/top/1567/gree-0109/size
abc.org/bottoms/1567/red-skirt-plus我试过abc\.org\/top\/[0-9]+\/(.*)$,但没有找到匹配的。
任何帮助都将不胜感激。
发布于 2018-04-04 15:46:32
试试这个:
abc\.org\/top\/[0-9][^\/]+\/[^\/]+$它将匹配:
abc.org/top/1010/red-shirt-plus
abc.org/top/1567/gree-0109但不是:
abc.org/top/1567/gree-0109/size
abc.org/bottoms/1567/red-skirt-plushttps://stackoverflow.com/questions/49655172
复制相似问题