I'm trying to find a way to match a single character except if it's inside a specific word.
The problem is I'm trying to find all the '/', but not the ones inside 'TCP/IP'. I found that a Negative Lookahead would do the job, but the problem is to exclude the whole 'TCP/IP' word. When I escape the '/', it makes the negative lookahead wrong.
The tested Regex is:
(?!TCP\/IP)\/
The data to test:
PHP/JAVA/TCP/IP/PYTHON/JAVASCRIPT
It should match every '/', except the one inside 'TCP/IP'
However, when I'm testing the regex with regex101.com, my negative lookahead part goes numb as I add the /:
Negative Lookahead (?!TCP\/IP)
Assert that the Regex below does not match
TCP matches the characters TCP literally (case insensitive)
\/ matches the character / literally (case insensitive)
IP matches the characters IP literally (case insensitive)
It seems like it's not considered as a single word anymore.
I think it can be fixed easily, but I'm out of solution at the moment.
Thanks.