Generation of regex matching script