Title is pretty much self explanatory...
I want to find a particular match but with condition.
I will give an example so it would be more clear:
http://www.example.com//test.htm
https://www.example.com/test.htm
https://www.example.com///test.htm
ftp://www.example.com//myFile.jpg
I want to find all // but except the the http://
so iow...
if there is a :
character (http://) before the //
ignore it...
return only matches that do not have :
before //
The answer provided by @georg would work for your case, if you want to make sure you're ignoring those specific conditions; you could use multiple lookbehind assertions:
(?<!http:)(?<!https:)(?<!ftp:)//
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.