Return all characters after a specific string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello All,
I am trying to get the hang of RegEx, but am having some trouble. I want to extract the city name after a column of identical strings, but different cities afterwards. My end goal is to retrieve Allen, Las Vegas, and San Diego as results from each line.
Kids Summer Camp 2021 At Location Allen
Kids Summer Camp 2021 At Location Las Vegas
Kids Summer Camp 2021 At Location San Diego
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @jkv0019
You can use replace function remove before string.
Replace([Field1], "Kids Summer Camp 2021 At Location ", "")
Workflow:
Hope this helps 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @jkv0019,
I wrote down some examples of how you can get that information. In addition to @atcodedog05 formula, you can also use Regex in many different methods:
- Parse method: By using the expression "Location\s(.*)" you'll be able to get everything that's after "Location ";
- Tokenize method: The same expression here with a split to columns will have the same results;
- Replace method: By using the expression ".*Location\s(.*)" you'll get the same results, but in this case the output will be in the same column, erasing your older data.
Also, if you want to test out your expressions, I always use Regexr. It's a very nice tool where you can input your text and check in real-time how the results are going to be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Does your search term change? Like sometimes you'll be looking for location and other times you'll be looking for something else? If so you'll need to use a non-regex method (no fun!) or use a regex in a batch macro/app search... ie both are doable but require some additional work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you. This is exactly what I had in mind!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How are your search terms coming in? user input or other file? Are you searching all of your rows or just one row for the term?
