SOLVED
Regex - capture the end of line value
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
ErikH
7 - Meteor
‎12-07-2018
05:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I'm trying to capture the value after the last "-", for example:
Lorem - 12345
Lorem -12p-129 - 12345
Lorem - ABCE1
Lorem Ip-24 - 123456
In many of the cases, I have several "-", but what I want is to fetch out the value after the last "-" in the line. This value can be numbers or text character or a combination of both. I've tried to use regex, but in the cases where yoyu have several "-"'s i fail.
Any help?
Thanks
Solved! Go to Solution.
Labels:
- Labels:
- Regex
2 REPLIES 2
ACE Emeritus
‎12-07-2018
05:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
REGEX_Replace([Field1], "^.*-([^-]+)*$","$1")
Should get you close to what you need
^.*-
Matches everything from start until the last - (greedily)
([^-]+)*$
Matches everything after last - through to the end and places in $1
‎12-07-2018
05:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Awesome, thanks!
