0

Suppose I want do define a special style for every character A that appears after the character B. If I do this?

    <context id="AAA" style-ref="punct">
      <match>[B][A]</match>
    </context>

then B itself gets highlighted, which I do not want; I want to highlight only the A. How can I do this?

Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183

1 Answers1

2

Use lookbehind:

<match>(?&lt;=[B])[A]</match>

(The < of the lookbehind operator needs to be escaped in XML.)

ptomato
  • 56,175
  • 13
  • 112
  • 165