On Wed, 11 Sep 2019, Brian Vogel wrote:
Quentin, I tried playing with, both of which were defined as regular expression without case sensitivity: [Nn][Oo]\.* (\d+) number \2The most obvious problem, is that \2 should be \1. You only have one capturing subexpression, so \2 should be undefined.
Using source string:
This is no. 5 and No. 6. No it isn't!
pattern: ([Nn][Oo]\\.*)(?= *\\d+)
and replacement: number
This is number 5 and number 6. No it isn't!
In Python, the (?=...) construct means "Match, but don't consume".
Note: tested at the python console with re.sub, not in NVDA directly.
[Nn][Oo](\s|$) NoThe above should cause any case combination of "no", optionally followed by a period, followed by a space, followed by one or more digits"Chanel number 5" with my expression above.
I would probably do your second pattern as:
Using that pattern, a replacement of "know", with this source string:
This is no no. 1, oh no!
This is know no. 1, oh know!
No. Way. This. is. No. 1!
know. Way. This. is. No. 1!