I need to write a regex that validates the input for a city. Except for characters only spaces are allowed and * acts as a wildcard character, so it can be either in the end or in the beginning of the string. * character should be allowed to be the only input as well.
Accepted strings:
*city*cit *'*'(only asterisk)*city one
Not accepted strings:
***!@%^&*
I have written this, but it doesn't allow only '*" as input. Any ideas?
'^.*[A-Za-zÀ-ÖØ-öø-ž ]{1,34}.*$'