Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Is it possible to use a regular expression in a ..ReplaceStr function

Question
Jonathan Harris · Mar 7, 2023

Is it possible to use a regular expression in a ..ReplaceStr function

Messages will contain fields with expressions like "REASON->Blood(1.23)" or "REASON->Bone(4.56)" or "REASON->Muscle Mass(7.89)". The word after the "->" can vary. I would like the outputs to be; "REASON(1.23)" or "REASON(4.56)" or "REASON(7.89)", basically removing "->" and the word or words that follow but leaving the parens and the numeric characters within.

Thanks,

Jonathan Harris

#InterSystems IRIS for Health

Source URL:https://community.intersystems.com/post/it-possible-use-regular-expression-replacestr-function