completed basic regex transpiler method