JavaVerbalExpressions
JavaVerbalExpressions copied to clipboard
anythingBut("abb") does not generate correct result when more than 1 character
Actually generated: (?:[^abb]*)
Expected to be generated: (?:a(?!bb)|[^a])+
or something like that.
can you provide complete example on how it should work?
I guess, the OP interprets anythingBut("abb") as any character, but not looking at "abb", and the thing repeated, i.e., (?:(?!abb)(?s:.))+ which is equivalent to his expression (modulo mistakes I may have done), but doesn't make much sense to me.