fork download
  1. var str = "__Definition:__ $x_0$ is an _ordinary point_ of the ODE $L[y] = 0$";
  2. var repl = str.replace(/_(?!(?:(?:[^$]*\$){2})*[^$]*$)/g, '\\_');
  3. print(repl);
  4.  
Success #stdin #stdout 0.38s 381888KB
stdin
Standard input is empty
stdout
__Definition:__ $x\_0$ is an _ordinary point_ of the ODE $L[y] = 0$