Regx
- 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
Can someone explain highlighted portion of below reg expression?
Input - It's going to be great great day output - It's going to be great day
\b(\w+)\s\1\b
Solved! Go to Solution.
- Labels:
- Regex
- 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
Hi @anupgupta12
I got it. Thought i remember it from somewhere. The expression should be something like this.
REGEX_Replace([Field1], "(\b\w+\b)\s\1", "$1")
Workflow:
\b - word wrap
\w+ - word
\b - word wrap
\s - space
\1 - same word as in bracket
Basically, if a word is repeated it reduces to one.
Hope this helps : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How did you come to know \b means word wrap, i don't see it in regex. Can you please tell me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @anupgupta12
Agreed its not there in the Regex tool's list. There are lot which can be used which is not there in the list. Refer this website>cheatsheet section it will give you idea about regex usages. Regex is mostly common across lot of languages.
Hope this helps : )
