CHG: replaced regex with real ast transformation