Forum Discussion
Hi,
The best example is below, it have three names separated by comma, so I thought of using some logic as
“regexp_substr(dossier_lead, ‘[[:alnum:] .()-]+, [[:alnum:] .()-]+’,1, level,‘i’)” it is working in oracle but it is hanging, so i thought of trying same logic in snaplogic.
Example: john, maria,lisa, awari,Arun, john(TCS)
Thank you for the additional information. I believe there was a typo in the initial post indicating that you could not use commas. If your JSON was something like “names” : “john, maria,lisa, awari,Arun, john(TCS)” you could use the expression $names.split(‘,’) which will result in a “names” array. If you want to remove the white space you could use $names.replaceAll(’ ‘,’‘).split(’,').
Screenshot of split only:
Screenshot of expression with replaceAll and split:
- pranil2k26 years agoContributor
Hi,
I tried above solution, but i am getting output as below.
but the excepted output will be combination of first name and last name (john, maria).
Any advice. Thanks
- cjhoward186 years agoEmployee
Hi @pranil2k2
Here is an expression that produces the results you are looking for:
$NAME.match(/[^,]+,[^,]+/g)
- pranil2k26 years agoContributor
HI,
Thanks for the information.
Anil