Hello, @roy-simpson, @terry-r, @peterjones and All,
@roy-simpson, may be the following regexes may help you to achieve your goal !
For the example below, don’t forget to tick the Wrap around option in the Replace dialog !
Given your last single line INPUT text, that you’ll paste in a new tab :
<math display="inline"><semantics><mrow> <mrow> <mtable columnalign="left"> <mtr columnalign="left"> <mtd columnalign="left"> <mrow> <mn>0</mn><mo>=</mo><mo>|</mo><mn>4</mn><mi>x</mi><mo>+</mo><mn>1</mn><mo>|</mo><mo>−</mo><mn>7</mn> </mrow> </mtd> </mtr></mtable></mrow></mrow><annotation-xml encoding="MathML-Content"><mrow> <mtable columnalign="left"> <mtr columnalign="left"> <mtd columnalign="left"> <mrow> <mn>0</mn><mo>=</mo><mo>|</mo><mn>4</mn><mi>x</mi><mo>+</mo><mn>1</mn><mo>|</mo><mo>−</mo><mn>7</mn> </mrow> </mtd> </mtr></mtable></mrow></annotation-xml></semantics></math>With this regex S/R :
FIND (?-s)(?:<.+?>)+([^< \r\n]|\Z)
REPLACE $1
You would be left with this tiny OUTPUT text :
0=|4x+1|−70=|4x+1|−7Now, with this simple regex S/R :
FIND .
REPLACE $0\x20
The OUTPUT becomes :
0 = | 4 x + 1 | − 7 0 = | 4 x + 1 | − 7And finally, with this third and last regex S/R :
FIND (.+)\1
REPLACE \\\( $1\\\)
You get your expected OUTPUT :
\( 0 = | 4 x + 1 | − 7 \)May be, get rid of the space char, between 4 and x, to simulate an implicit multiplication sign !
Happy New Year !
Best Regards,
guy038