Fixed visibility of methods using the Pattern class