Regular expression to Match addresses
Posted
by
Burfi
on Stack Overflow
See other posts from Stack Overflow
or by Burfi
Published on 2012-09-23T09:22:54Z
Indexed on
2012/09/23
9:37 UTC
Read the original article
Hit count: 245
I have below set of strings to be searched :
1Dept Neurosci, The Univ. of New Mexico, ALBUQUERQUE, NM; 2Mol. and Human Genet., Baylor Col. of Med., Houston,, TX; 3Psychiatry, Univ. of Texas Southwestern Med. Ctr., Dallas, TX; 4Clin. Genet., Erasmus Univ. Med. Ctr., Rotterdam, Netherlands; 5Human Genet., Emory Univ., Atlanta, GA
Above is a set of addresses , which starts with a digit (used to link it to the person).Need to search all the address as :
1Dept Neurosci, The Univ. of New Mexico, ALBUQUERQUE, NM
2Mol. and Human Genet., Baylor Col. of Med., Houston,, TX
3Psychiatry, Univ. of Texas Southwestern Med. Ctr., Dallas, TX
4Clin. Genet., ErasmusUniv. Med. Ctr., Rotterdam, Netherlands
5Human Genet., Emory Univ.Atlanta, GA
I have written the below Regex :
\d\w+,*
It only matches a digit followed by a word . How can I modify it .Please suggest is there any better way.
© Stack Overflow or respective owner