get the matched regular expression position in string.

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Sep 3 04:33:57 EDT 2012


On 03/09/2012 09:18, contro opinion wrote:
> Here is a string :
>
> str1="ha,hihi,aaaaa,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 here that demonstrates the problem, what 
you expect to happen, what actually happened, and if appropriate the 
complete traceback.

-- 
Cheers.

Mark Lawrence.




More information about the Python-list mailing list