changes regex to matches