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/
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? page/number
, the regex should be (?<=\\/)[\\w_\\]+(?=\\/)
page
, number
, try (?<=\\/)[\\w_]+(?=\\/)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.