Replacing Text With Regular Expressions

My goal is to archive the following transformation in 5 steps, and I want to know if it is possible to do this in mel or if I need to build a MPxCommand which uses PCRE (or would you recommend some other approach than PCRE?):

  1. ((step & sand) | wind) & (and | or)
  2. ((step & sand) | wind) & (:a: | :slight_smile:
  3. ((step and sand) or wind) and (:a: or :slight_smile:
  4. (((file like '%step%') and (file like '%sand%')) or (file like '%wind%')) and ((file like '%:a:%') or (file like '%:%'))
  5. (((file like '%step%') and (file like '%sand%')) or (file like '%wind%')) and ((file like '%and%') or (file like '%or%'))
    admittedly, the last step is trivial.

Daniel

Maya has a PCRE like regexp subster yes, its a bit of subset but its there (and the more robust version isn't in the docs)

if all esle fails use python

basically you want to use

substitute "string" "s/str/ummmm/"