AniNair wrote: > hi.. I am trying to match '+ %&/-' etc using regular expression in > expressions like 879+34343. I tried \W+ but it matches only in the > beginning of the string Plz help Thanking you in advance... >
Is this what you are seeking for?
>>> re.compile('(\+{0,1})?([0-9]+)').findall('879+34343')
[('', '879'), ('+', '34343')]
Tuomas Vesterinen
--
http://mail.python.org/mailman/listinfo/python-list
