Help with regex - how to first seperate string by >< then use a patten

I would like to use regex to extract som data from a txt file. But all the data comes as a long string whit no spaces

ValueValueValueValueValue

Say I only want to extract the the string from to . I guess that it´s possible to first insert a space betweeen all >< then use regex patter starts with ends with but how do I first insert?

Or should I do any other way?

can i have the sample of your string to be processed?

Lets say i want to extract the “block” bn-kontakt-privat

community5387 .txt (2.6 KB)

It uploads as a xml but I have it saved as a txt file on my computer.

Hi @Zlotzky

Can u try with the regex

             Regex pattern : (?=<bn-kontakt-privat>)[\S \n]+(?=<rg-fastighetsbeteckning>)

regards
Nived N
Happy Automation

Why are you not using XML activity?

1 Like

I have tested, and could print the values in the log but did not manage to build a for each loop so they were saved in different columns in the database.

Also could not extract the text that have special characters (swedish å ä ö)5387.xml (2.5 MB) Zlotzky (1).xaml (9.8 KB)

Hi @Zlotzky

Did u tried the regex pattern I told ?

Yes,thanks! It works. But I have problem worx the encoding on the swedish letters …

Hämta Outlook för iOS

Hi @Zlotzky

I didn’t understand

Can u explain clearly please?

Thanks a lot, I solved it. I changed the encoding to (iso-8859-15 latin 9 iso) insted of the diffrent encodings that were lable with swedish.

~WRD000.jpg