File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regular expression issue

 
Rajive Jha
Greenhorn
Posts: 2
  • 0
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic