How to retrieve the pattern string from a defined rule.