[oXygen-user] Bug in regular expression negative lookbehind?

Adrian Buza
Fri Nov 12 03:07:21 CST 2010


Thank you for letting us know about this problem.

Both positive and negative lookbehind are affected. For positive try: 
(?<=o)o  - it skips every other 'o', matching only half of them(only the 
'o's at even locations)

This happens because for Find Next/Previous Oxygen always searches in a 
substring starting from the caret(it does not look behind ahead of the 
caret position).
Obviously this is a mistake and we'll have to change this behavior. I've 
added it to our issue tracking tool and we'll resolve it in a future 
version of Oxygen.

As a workaround you can use "Find All" which obtains correct results for 
both positive and negative lookbehind.

Let us know if you encounter further issues.


Adrian Buza
oXygen XML Editor and Author support


David Sewell wrote:
> Platform: oXgen 12.0, build 2010100114
> OS X 10.6.4, standalone Java version
> Problem:
> Given this text:
>    It is very cooooooold today.
> The regular expression search
>    	(?<!o)o
> should match only two 'o's, the one after 'c' and the one after 't' (the
> regex says "match any o not preceded by 'o'"). Correct?
> When I try it, the search matches every 'o'.
> Positive lookbehind, and lookahead searches, seem to be okay but I have
> not tested very much.
> David S.

More information about the oXygen-user mailing list