[texworks] Regex challenges

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Apr 10 16:45:50 CEST 2009


Stefan Löffler wrote:
> I guess this could be achieved by lookbehind assertions (?<=...). I'm
> not sure if they are supported by QRegExp, however (lookahead assertions
> are explicitly mentioned in the documentation, but lookbehind assertions
> are simply omitted). You'd have to try it out to see if it works. Maybe
> something like
> (?<=\n%.*)^^A.*
> (Note: This will fail on the first line (since it doesn't start with a
> \n) and may have other flaws. But it could get you started)
> 
> If this doesn't work, you could try
> (?<=a).
> This should match any character that is immediately preceded by an 'a'.
> If this doesn't work either Qt probably doesn't support lookbehind
> assertions.

Hello Stefan,

Thanks for that: after tests, I conclude that QRegExp doesn't support
lookbehind assertions.  Was worth a try!
-- 
Joseph Wright


More information about the texworks mailing list