I have this simple regular expression to catch the last instance of "turn to 123" in the form (I have another regular expression for the main body):
currenttext=currenttext.replace(/([^>])(turn\s+to\s+)(\d+)$/i,"$1<tt ref=\"$3\">$2$3</tt>");
which, for example, replaces turn to 123 ... with
<tt ref="123">turn to 123</tt>...
... in live mode. However, it only works if there is a form character after number 123, whether it is a carriage return or a visible character that I cannot understand, since the $ end of match binding clearly does not have another character before the memory pattern for numeric digits. Without the following character, I get this result:
<tt ref="12">turn to 12</tt>3
i.e. he cannot catch the last digit completely. I tried putting $ anchor inside the memory folders, but it didn't make any difference.
source
share