""Ron Brennan" <rb******@magma.ca>" wrote in comp.lang.java:
"Ron Brennan" <rb******@magma.ca> wrote in message
news:oO********************@magma.ca...
Good morning.
I would like to use one or more RegExp to validate country names as having
the first and last words beginning with an uppercase letter, intermediate
words beginning with either uppercase or lowercase, and all other
characters being lowercase characters. The difficult part is that I want
to obtain save the string positions of the invalid characters in an array,
rather than just obtain a true or false value.
Can anybody with more experience with Regular Expressions than me suggest
some code, sites, or approaches.
For example:
Turks and Caicos
I strongly recommend you get the following book because it will really
help with understanding everything that Regular Expressions can do for you:
Mastering Regular Expressions, Second Edition
Jeffrey E. F. Friedl
O'Reilly & Associates, 2002
ISBN 0-596-00289-0
Note: If you're already familiar with using Regular Expressions in
PERL, then this book will definitely be more useful to you.
By the way, can you tell us a little bit about the project you're
working on? It would be interesting to know where this type of functionality
is needed.
--
Randolf Richardson, pro-active spam fighter -
rr@8x.ca
Vancouver, British Columbia, Canada
Sending eMail to other SMTP servers is a privilege.