I have a string in quotation marks (eg. "Water") but my string value may contain " in the middle ("Wa"ter"). I am trying to write Regex to replace the " surrounded by characters with " - "Wa"ter"
REGEX_Replace([String1], '.+(").+', """).
However, this is replacing the entire string with ". Can you recommend regex to obtain the results I want?
Solved! Go to Solution.
hi @busybee
You'll want to double check this with other examples in your data, but this formula works for the one you presented.
REGEX_Replace([String1], '([^"]*"[^"]*)"(.*)', "$1"$2").
Greg
Hi @busybee — Try this solution:
Use a RegEx tool with Replace output method like below:
(^"\w+)(")(\w+"$)
$1"$3
If this solves your issue please mark the answer "Solved" with a Like, if not let me know!
Hi @busybee,
Here is the solution to your problem.
REGEX_Replace([Field1], '([^"]*"[^"]*)"(.*)', "$1"$2")
I hope it helps.
My Input String consists of combinations of alphanumeric and non alphanumeric characters. I had to tweak your suggestion as follows to get the results.
REGEX_Replace([Input], '(.+)"(.+)', '$1"$2')
Thank you all for your help.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |