updated to conform to the latest API of sregex.