Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: get the matched regular expression position in string.

Reply
Thread Tools

Re: get the matched regular expression position in string.

 
 
Mark Lawrence
Guest
Posts: n/a
 
      09-03-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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: get the matched regular expression position in string. Vlastimil Brom Python 0 09-03-2012 11:36 AM
Re: get the matched regular expression position in string. Chris Rebert Python 0 09-03-2012 08:36 AM
Replacing part of a matched regular expression using gsub Ben Ruby 4 03-25-2008 10:27 AM
Regular Expression - Show error if string is matched? monkeyjunkie ASP .Net Web Controls 1 11-11-2004 11:26 AM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM



Advertisments