Implemented registration and deregistration of custom pattern functions