You need to sign in to do that
Don't have an account?
ketan vinodrai mehta
RegEx to replace newline characters between two double quotes.
Hi All,
I am looking for a solution to replace all newline character occuring between two double quotes. I have already referred below URL https://stackoverflow.com/questions/26337474/regexp-to-find-replace-newlines-within-double-quotes-not-affecting-newlines-out and tried to execute below code but seems like something is missing.
String rawString = Label.TestLable;
String result = rawString.Replace('([^"\n]*)\r?\n(?!(([^"]*"){2})*[^"]*$)/g', '<br>');
The TestLabel custom label has string with multiple newline characters and enclosed within double quotes below:
"
Hello Team
Requesting you to join us at marathod event happening at below venue
"
And the out put expected is:
Hello Team <br>Requesting you to join us at marathod event happening at below venue
I am looking for a solution to replace all newline character occuring between two double quotes. I have already referred below URL https://stackoverflow.com/questions/26337474/regexp-to-find-replace-newlines-within-double-quotes-not-affecting-newlines-out and tried to execute below code but seems like something is missing.
String rawString = Label.TestLable;
String result = rawString.Replace('([^"\n]*)\r?\n(?!(([^"]*"){2})*[^"]*$)/g', '<br>');
The TestLabel custom label has string with multiple newline characters and enclosed within double quotes below:
"
Hello Team
Requesting you to join us at marathod event happening at below venue
"
And the out put expected is:
Hello Team <br>Requesting you to join us at marathod event happening at below venue
Use below regex for your output,
Hope this will work for you.
Thanks
karthik
'); The provided solution is not working and on the other hand, I do not see you are considering to replace newline characters only within double quotes. Regards, Ketan Mehta
Did you find the fix for this , i am still stuck in same issue.