I have a JS regex with a negative lookbehind assertion that works fine in Chromium-based browsers:
(?<!https?:)\/\/(.+?)(?<!https?:)\/\/gmi
I need to replace it to another for cross browser compatibility (won't work in FF or Safari).
Regex means "Find and capture all occurrence inside slashes // //, except if before // stay http: or https:".
Example:
bar //foo bar// foo - match (capture //foo bar//)
//https://stackoverflow.com/// - match (capture https://stackoverflow.com/)
https://stackoverflow.com// - not match
//foo http://stackoverflow.com - not match
As @BaliBalo said, my current regex contains error and work not perfectly
Error Demo
I need capture https://stackoverflow.com/
in //https://stackoverflow.com///