Thx, didn't know about regex. With that installed and 
    
    
    # processcode.nim
    
    import macros, regex
    
    macro regexReplace*(sub, by, src: string): untyped =
      src.strVal.replace(sub.strVal.re, by.strVal).parseStmt
    
    
    Run

the code actually works.

Reply via email to