I am trying to write Regex for a 3 letter alphabetical string which is not empty. I have tried the following
(?=(^$)|(\s+$))(?=[A-Z]{3})
I know that ?= acts as and operator,(^$)|(\s+$)
check for non empty and white space, but the following regex is not working. unable to find out whats wrong in this. Any help would be appreciated.
My regex should check first whether the string is empty and if the string is not empty then it should check whether is alphabetical and length is 3 following are examples
1."" - should fail
2."LGW" - Should pass
3."LGWE" - should fail
4."LG!@"- should fail
5."12L"-should fail