Hello, @Sylvester-Bullitt, @peterjones, @coises and All,
The @coises’s answer is quite clever. Personally, I ended up with this search/mark regex :
SEARCH / MARK (?=(?-i:\u\l))(?i:(\u)\1)
which uses a look-ahead expression at the beginning, instead of the look-behind expression at the end of the @coises’s regex :
(?i:(\u)\1)(?<=(?-i:\u\l))
You could say: it’s a minor difference, but it isn’t !! Indeed, as our Boost regex engine dos not allow look-behinds containing non-fixes expressions, my version has the advantage to work with any syntax of the look-ahead !
For example, from the INPUT text :
Aaaaaaaa Axxxxxx
Bbbbbbbbbbbbbbbbbbbb Bxxxxxx
Cccc Cxxxxxx
AAAAAAAA Axxxxxx
BBBBBBBBBBBBBBBBBBBB Bxxxxxx
CCCC Cxxxxxx
The regex (?=(?-i:\u\l+))(?i:(\u)\1+) would mark the left part of the first three lines, before the space char
But the regex (?i:(\u)\1+)(?<=(?-i:\u\l+)) would just display the message Find: Invalid regular expression
Best Regards,
guy038