1

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 //

davidmarko
  • 323
  • 3
  • 15

1 Answers1

1

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:)//
hwnd
  • 65,661
  • 4
  • 77
  • 114