extract regexp wrapper into standalone class