Re: get the matched regular expression position in string.

Discussion in 'Python' started by Mark Lawrence, Sep 3, 2012.

  1. 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.
    Mark Lawrence, Sep 3, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    2
    Views:
    2,268
  2. monkeyjunkie

    Regular Expression - Show error if string is matched?

    monkeyjunkie, Nov 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    175
    Robert Koritnik
    Nov 11, 2004
  3. Ben
    Replies:
    4
    Views:
    130
    Robert Klemme
    Mar 25, 2008
  4. Chris Rebert
    Replies:
    0
    Views:
    170
    Chris Rebert
    Sep 3, 2012
  5. Vlastimil Brom
    Replies:
    0
    Views:
    201
    Vlastimil Brom
    Sep 3, 2012
Loading...

Share This Page