Python re.search simple question

Ganesh Pal ganesh1pal at gmail.com
Mon Dec 8 02:17:44 EST 2014


Thanks guys , I escaped the '[' character and my issue is sloved ..  Thank
you guys u all rock :)

Regards,
Ganesh

On Mon, Dec 8, 2014 at 12:41 PM, Zachary Ware <zachary.ware+pylist at gmail.com
> wrote:

> On Mon, Dec 8, 2014 at 12:52 AM, Ganesh Pal <ganesh1pal at gmail.com> wrote:
> > Hi Folks ,
> >
> > This  might seem to be very trivial question but iam breaking my head
> over
> > it for a while .
> >
> >  My understanding is that re.search should search for the match anywhere
> in
> > the string .
> >
> >
> > why is re.search failing in the below case  ??
> >
> >>>> pattern
> > 'Token-based migrations cannot be mixed with level-based: [prev 0 , now
> 1]'
>
> Your pattern here contains a character class ([enoprvw 01,]).  You'll
> need to escape the '[' character to make it literal.
>
> Hope this helps,
> --
> Zach
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141208/924bb68d/attachment.html>


More information about the Python-list mailing list