regex dont match if it is an empty string

Viewed 7453

Currently, I am using /^[a-zA-Z.+-. ']+$/ regex to validate incoming strings.

When the incoming string is empty or only contains whitespace, I would like the code to throw an error.

How can I check for empty string using regex? I found some solutions but none are helpful.

3 Answers
Related