refactor: updated to conform to the new API of sregex.