Implement regex patterns.