(refactor) updated regex to handle dot notation