Hi, I am trying to replace a string in a txt-file with the app String Replace.
Incoming:
helloworld<mailto:name@domain.com></email>
Wanted result:
helloworld</email>
The email adress is variable, so what I would like to do is:
<mailto:*></email>=</email>
but that doesn't work with the String Replace app.
Any suggestions how to solve this?
ps.I don't have the scripting module, only the metadata module.
String Replace
- magnussandstrom
- Advanced member
- Posts: 362
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: String Replace
I have not tried but the documentation of the app says that the replace part can be a regular expression and the regex in this case should be:
I have the impression you were thinking in terms of wildcards, but regular expressions are different. <mailto:* in your regex is interpreted as <mailto followed by a colon 0 or multiple times. In the above example the interpretation is <mailto: followed by any character 1 or multiple times.
Code: Select all
<mailto\:.+><\/email>
- magnussandstrom
- Advanced member
- Posts: 362
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: String Replace
Thanks Freddy, that solved it! I did try to solve my self with regular expression but didn't get it right. Thanks!