Regex replace function for formatting
- 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 have multiple words in a string like;
I would like to use regex_replace function to convert strings to a specific format like "model 1, tommy srarcha" (with no quotations) so I want to read it backward and stop at the last letter of the first word then put comma, then read it forward until the last word.
"tommy srarcha model" = model, tommy srarcha
"asmali tomas sparak assel"= assel, asmali tomas sparak
etc
Thanks for your help
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Quick answer Yes:
Longer answer Yes, but no:
Attached is a workflow that parses a field and turns to rows each of the words. The words are given a word# and all incoming data is sorted so that the last word is first and the first word is last. The data is then put back together with (SPACE) as the delimiter. The first space is replaced with a comma followed by a space. You get what you wanted, but I didn't use RegEx to do it.
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- 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
I agree with you and want you to know that I over-engineered.
I thought that we had to reverse all of the words. That's why I didn't go down a regex path.
You took the last word added a comma and space, then appended the rest of the original data.
One Two Three would become: Three, One Two
I made the answer: Three, Two One.
My bad
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- 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

