I want to replace a single <, but not <<, using a Java regexp (so I'm working with String.replaceAll()). Right now I have
([^<]|^)<([^<]|$)
which works in Python, but not Java. I have also tried negative look-around, with something like
(?<!<)<(?!<)
However, all my current attempts match << as well. Am I doing something wrong? Is there any Java-specifics here I don't know about?