Page 1 of 1

String Replace

Posted: Wed Nov 11, 2020 3:52 pm
by JimmyHartington

I am trying to use the String Replace app ... ng-replace to fix/cleanup the HTML of an e-mail received by Switch.

This is a part of the HTML

Code: Select all

  <br><b>Send til:</b>
  <br>StagehĂžjvej 27a
  <br>Silkeborg,  8600
  <br><b>Papiromkostninger:  </b>kr. 0,00
  <br><b>Prepress-omkostninger:  </b>kr. 0,00
  <br><b>Trykkeomkostninger:  </b>kr. 0,00
  <br><b>Indbindingsomkostninger:  </b>kr. 0,00
  <br><b>Forsendelsesomkostninger:  </b>kr. 0,00

I am trying to remove the lines with:

I also add a stylesheet at the start of the file.

This is my multiline value in your app.

Code: Select all

</head>=</head><style>  @media print {  @page {  size: 297mm 420mm; margin: 10mm; }  body { margin: 10mm; }}</style>

The first line replaces fine.
But on the second line I try to use RegExp to remove the line with Papiromkostninger, but it does not work.

Is there some certain way I need to define the RegExp to get it to work?

Re: String Replace

Posted: Wed Nov 11, 2020 4:14 pm
by JimmyHartington
I found the answer elsewhere on the forum viewtopic.php?f=13&t=3740&p=11542&hilit ... ext#p11542

So the greedy ? in RegExp is not supported in Switch.

But I the used the {3,180} to define a shorter amount of characters to look for.