Very simple question but I can't seem to figure it out.
The following code:
import re
addr = '800 W NORTH AVE'
re.sub(r'([a-zA-Z]+)', 'W North A', addr)
It gives me as a result 800 W North A W North A W North A instead of 800 W North A
I don't understand what am I doing wrong. Would appreciate any help.
Thanks
c:\python27\tools\scripts\redemo.py(season to your environment) that will visualize regex matching for you.'800 W NORTH AVE'.title()instead...