Regex wizards look here!

Hey,

Using regex matches to extract text from a pdf. The pdf contains a lot of text, i’ve managed to get most of it but i find the studio to be a bit picky when it comes to some regex patterns. Some work in online editors like regex101 but not in the studio. I have this text:

Blockquote

Arbetsrelaterat mobilnummer Ange mobilnummer
070777445
Kostnadsställe och Omfattning Ange kostnadsställe Ange omfattning (%)
1234 40
Tjänsteställe - Välj i lista
Välj tjänsteställe

Befattning Välj befattning i lista
Specialist Teknik (IV,PR)

Ange timpris Timpris i kronor

Blockquote

This line: “Specialist Teknik (IV,PR)” is from a form and changes accordingly. It is the one i need to extract.
This pattern works in the online editor: (?<=Befattning\sVälj\sbefattning\si\slista\s)\w+
But not in the studio. and even if i get the studio to match, its not picking the string up.
I use an assign activity to convert the arrayitem from the mathes activity to a string.

Any ideas on how to do this?

Have you tested with the following pattern:

(?<=Befattning\sVälj\sbefattning\si\slista\s+).+

image

image

that worked. gah, thanks, must be the two + at the end that i missed. thanks a lot!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.