Re: get the matched regular expression position in string.

2012-09-03 Thread Vlastimil Brom
2012/9/3 contro opinion : > Here is a string : > str1="ha,hihi,a,ok" > I want to get the position of "," in the str1,Which can count 3,8,14. > how can I get it in python ? > -- > http://mail.python.org/mailman/listinfo/python-list > Hi, you can use re.finditer to match all "," and the start()

Re: get the matched regular expression position in string.

2012-09-03 Thread Chris Rebert
On Mon, Sep 3, 2012 at 1:18 AM, contro opinion wrote: > Subject: get the matched regular expression position in string. As is often the case in Python, string methods suffice. Particularly for something so simple, regexes aren't necessary. > Here is a string : > > str1="h

Re: get the matched regular expression position in string.

2012-09-03 Thread Mark Lawrence
On 03/09/2012 09:18, contro opinion wrote: Here is a string : str1="ha,hihi,a,ok" I want to get the position of "," in the str1,Which can count 3,8,14. how can I get it in python ? Write some code using an appropriate string method. If it doesn't work put the minimum piece of code her

get the matched regular expression position in string.

2012-09-03 Thread contro opinion
Here is a string : str1="ha,hihi,a,ok" I want to get the position of "," in the str1,Which can count 3,8,14. how can I get it in python ? -- http://mail.python.org/mailman/listinfo/python-list