> >>> s='555tHe-rain.in#=1234' > >>> import re > >>> r=re.compile(r'([a-zA-Z]+|\d+|.)') > >>> r.findall(s) > ['555', 'tHe', '-', 'rain', '.', 'in', '#', '=', '1234'] This is nice and simple and has the invertible property that Patrick mentioned above. Thanks much! -- http://mail.python.org/mailman/listinfo/python-list
- regex help: splitting string gets weird groups gry
- Re: regex help: splitting string gets weird groups MRAB
- Re: regex help: splitting string gets weird groups Jon Clements
- Re: regex help: splitting string gets weird groups Patrick Maupin
- Re: regex help: splitting string gets weird groups Tim Chase
- Re: regex help: splitting string gets weird groups gry
- Re: regex help: splitting string gets weird groups Jon Clements
- Re: regex help: splitting string gets weird groups gry
- Re: regex help: splitting string gets weird groups Patrick Maupin