On Mon, 17 Jun 2019, 22:57 Daniele Zambelli, <daniele.zambe...@gmail.com>
wrote:

Mi resta ancora un problema:
>
> Nella situazione (poco probabile) che nel sorgente LaTeX ci sia la
> sequenza "\$" in questo caso il dollaro non va considerato come un
> delimitatore di formule. Come posso fare a convincere re a saltare i
> dollari preceduti da "\"?
>
> È possibile?
>

Positive and Negative Lookbehind

Lookbehind has the same effect, but works backwards. It tells the regex
engine to temporarily step backwards in the string, to check if the text
inside the lookbehind can be matched there. (?<!a)b matches a "b" that is
not preceded by an "a", using negative lookbehind. It doesn't match cab,
but matches the b (and only the b) in bed or debt. (?<=a)b(positive
lookbehind) matches the b (and only the b) in cab, but does not match bed
 or debt.



Ciao.

Marco.
_______________________________________________
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python

Rispondere a