Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28342

Re: get the matched regular expression position in string.

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: get the matched regular expression position in string.
Date 2012-09-03 09:33 +0100
References <CA+YdQ_4xRsyPaXgEpc6UEA9NUWoQp3GZGijQYncBStZg5ExYFw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.132.1346661196.27098.python-list@python.org> (permalink)

Show all headers | View raw


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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: get the matched regular expression position in string. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-03 09:33 +0100

csiph-web