Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regular expression issue

 
Rajive Jha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement where in i have validate a company name which accepts only:
Alphabets
numbers
apostrophe
a space between each word

The name shall always start with a alphabet and if there are multiple words only 1 space shall be allowed.
last letter of the name can also be apostrophe.


Can someone guide me how to write such regex.

Thanks
Rajiv
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!