Extract Text from a String
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
rjesus1987
6 - Meteoroid
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Need guidance/expertise on how to extract a specific phrase/text from a string using a formula tool (eg. REGEX Replace). I tried REGEX Replace ( REGEX_Replace([Question], '(\d+) .*', '$1') ) but can only get result 1 but having a hard time extracting result 2.
Based on the Question column, I need to show add to new columns (Result 1 & result 2)
Question | Result1 | Result 2 |
1.1 What is your name | 1.1 | What is your name |
2.11 Where do you live | 2.11 | Where do you live |
3.1 What is the name of your 1st pet | 3.1 | What is the name of your 1st pet |
4.15 How old are you | 4.15 | How old are you |
Labels:
- Labels:
- Regex
2 REPLIES 2
Pilsner
11 - Bolide
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @rjesus1987
I have given this a go using the Regex tool.
The statement used ([1-9\.]+)\s to get all numbers and decimal points, up to the first space.
The statement \s(.*) gets everything after the first space.
By setting the regex to Parse, you can get the two results columns you are after.
Please let me know how you get on.
Regards - Pilsner
binuacs
21 - Polaris
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@rjesus1987 try
