There are lots of posts about regexs to match a potentially empty string, but I couldn\'t readily find any which provided a regex which only matched an emp
Another possible answer considering also the case that an empty string might contain several whitespace characters for example spaces,tabs,line break characters can be the folllowing pattern.
pattern = r"^(\s*)$"
This pattern matches if the string starts and ends with zero or more whitespace characters.
It was tested in Python 3