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
^$ -- regex to accept empty string.And it wont match "/n" or "foobar/n" as you mentioned.
You could test this regex on https://www.regextester.com/1924.
If you have your existing regex use or(|) in your regex to match empty string.
For example
/^[A-Za-z0-9&._ ]+$|^$/