Regex-based parsing with applicative interface