Skip to content
Advertisement

Tag: regex-negation

Is it possible to use only lookaround to match characters that are not repeated immediately before and after?

For example, to match the first slash after the domain name in the URL. Intent: Only match ‘/’ in ‘.com/…’ but not any ‘/’ in ‘https://’. The above [A] returns the correct match, but [B] is the kind of expression I want (although it did not match any characters), that is, to use the / character only 1 time in

Advertisement