@Voice Aloud Reader regex supports Perl compatible regular expression syntax through DEELX
engine, which make me think the following might work:
(?:^T|\G(?!^)).*?\Ke
See the online demo
(?:
- Open non-capturing group.
^T
- Match start string ancor and "T" literally.
|
- Or:
\G(?!^)
- Assert position at end of previous match but prevent it from being at the start of the string with negative lookahead.
)
- Close non-capturing group.
.*?
- Capture any character between zero and unlimited times but as few as possible. Lazy match!
\K
- Reset starting point of the reported match.
e
- Match "e" literally.
Note: As per @TheFourthBird, you can further reduce backtracking if you'd replace .*?
with [^e\r\n]*
.
Another option could possibly be:
^[^T].*(*SKIP)(*F)|e
See the online demo
^
- Start string ancor.
[^T]
- Match anything other than "T".
.*
- Match any character other than newline zero or unlimited times.
^(*SKIP)(*F)
- Don't allow backtrack and force the pattern to fail. All characters to the left of (*SKIP)
are now ignored.
|
- Or:
e
- Match a literal "e".
EDIT:
Maybe more interesting in DEELX
regex engine even is the RIGHTTOLEFT
mode to match "Backward assertion". This would be different to Perl-like syntax which only allows fixed-width lookbehind. From the docs:
"DEELX uses RIGHTTOLEFT mode to match "Backward assertion". The backward assertion has the same logic as lookahead assertion, except the direction. So, in DEELX, the backward assertion works for non-fixed width lookbehind."
That makes me believe the following should work:
(?<=^T.*)e
(?<=^T.*)
- Non-fixed width lookbehind matching start string ancor, a literal "T" and zero or more characters other than newline.
e
- Match a literal "e".
Unfortunately I have no means of testing this, but the theory suggests it should work.
Replace all options with "3".