Regex for single character and empty String(Not white space) -


i have optional fields in have accept single character , should accept empty string. ex: if have middle name field, in accepts single char. in future if don't want middle name on account should persist empty middle name in database.

i used below regexp. not working accept empty string [^$]|[a-za-z]+

could 1 me on this?

how ^[a-za-z]?$ (one or 0 letters)?


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -