Search code examples
mulemulesoft

regex to remove special characters in mule3


I am getting some inputs in Mule3 and all have some special characters.

examples of input string is as below:

 "@不mule@#soft还!#%%"

I need to remove all special characters and need only "mulesoft" as string in output (or you can say only alphanumeric characters from string)

I have researched some regex but didn't get any luck


Solution

  • another way of getting desired output

    %dw 1.0
    %output application/json
    %var text = "@不s/\p@#ecial还!#%%"
    ---
    "output": text replace /([^0-9a-zA-Z]+)/ with ""