Re: Finding the carret position in a regular expression

2006-11-23 Thread Tool69
Thanks Fredrik, I was not aware of finditer. Iterators are very usefull ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the carret position in a regular expression

2006-11-23 Thread Fredrik Lundh
Tool69 wrote: > supposed I've got the following text : > > mytext = "for in :" > > with the following simple pattern : pattern = "<[a-z]+>" > > I use re.findall(pattern, mytext) wich returns : > ['',''] > > Now, I want my prog to return the positions of the returned list > elements, ie : > w

Finding the carret position in a regular expression

2006-11-23 Thread Tool69
Hi, supposed I've got the following text : mytext = "for in :" with the following simple pattern : pattern = "<[a-z]+>" I use re.findall(pattern, mytext) wich returns : ['',''] Now, I want my prog to return the positions of the returned list elements, ie : was found at position 5 in mytext w