[英]Regex to find a pattern of string between slashes
我正在为此寻找正则表达式的正确方法:
我有这些站点,我需要剪切字符串或斜线之间的任何内容 。 使用https://regexr.com/
我有这个结果。 有人可以帮我吗?
http://example.com/string/anotherThings
http://example.com/string/anotherThings
http://example.com/string_string/anotherThings
https://test.com/page/number/1
: https://test.com/page/number/1
,实际上是您想要的? page/number
,则正则表达式应为(?<=\\/)[\\w_\\]+(?=\\/)
page
, number
,请尝试(?<=\\/)[\\w_]+(?=\\/)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.