making pattern to work with regular expressions