[英]Regex to find a pattern of string between slashes
I'm looking for the right way to build the regex for this: 我正在为此寻找正则表达式的正确方法:
I have these sites and I need cut the word string or whatever have between slashes. 我有这些站点,我需要剪切字符串或斜线之间的任何内容 。 Using the https://regexr.com/
使用https://regexr.com/
I had this result. 我有这个结果。 Someone can help me?
有人可以帮我吗?
http://example.com/string/anotherThings
http://example.com/string/anotherThings
http://example.com/string_string/anotherThings
https://test.com/page/number/1
, which one do you actually want? https://test.com/page/number/1
: https://test.com/page/number/1
,实际上是您想要的? page/number
, the regex should be (?<=\\/)[\\w_\\]+(?=\\/)
page/number
,则正则表达式应为(?<=\\/)[\\w_\\]+(?=\\/)
page
, number
, try (?<=\\/)[\\w_]+(?=\\/)
page
, number
,请尝试(?<=\\/)[\\w_]+(?=\\/)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.