我有以下四个URL,其中我只想使用regex表达式过滤两个URL。
/chassis/motherboard/cpu <-这个
/chassis/motherboard/cpu/core0
/chassis/motherboard/cpu0 <-这个
/chassis/motherboard/cpu1/core0
我试着玩^.*[0-9a-z_].cpu,但我无法得到解决方案。
发布于 2016-09-25 07:52:52
您可以使用这个regex:
^.*/cpu[0-9]*$这将匹配以/cpu或/cpy<number>结尾的任何文本。
https://stackoverflow.com/questions/39684549
复制相似问题