I’m trying to use replace function to remove the special characters, but the escape characters are not being removed.
Input:
[
{
"MiddleName": "Gisela"mn"
},
{
"MiddleName": "Gisela12---"
}
]
Spec:
[
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"MiddleName": "=replace('(\-\s*)|\s+--',@(1,MiddleName))"
}
}
}
]
The output I’m getting:
[
{
"MiddleName": "Gisela"mn"
},
{
"MiddleName": "Gisela12"
}
]
The output I need:
[
{
"MiddleName": "Giselamn"
},
{
"MiddleName": "Gisela12"
}
]
2
Answers
You can consecutively use split and join functions such as
You can use simpler way like this spec: