Vito
September 9, 2022, 11:06am
1
Hello there!
Im making an automation but i got a problem with extracting words.
To be exact I need everything after city in this response:
“Country: Netherlands (NL)
State: Zuid-Holland
City: Leidschendam-Voorburg”
Do any of you guys know how to fix this problem?
Hi @Vito
This can be done using Regex. See here for some examples:
In regular cases it’s very usefull to use Regex (or Regular Expressions) if you want to extract or replace data in some text. When there always is a similar pattern in your text data, regex is ideal to use. But how can you use regex?
Setup
To be able to develop your own regex, there are a few very helpfull tools and processes which helps you getting started. These are my own personal recommendations, if you have anything extra to add up feel free to comment. Some of the things I use and do to …
Cheers
Gijs
How does this work for you? Capture group 1 will have your city. It uses the lookbehind for City: followed by 0 or 1 white space character
(?<=City:\s?)(.*)
1 Like