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


Groups > comp.lang.python > #82114

Re: Python re.search simple question

References <CACT3xuVW4w0rj_D7rfUpQgK8w76wCYUmk7RFbhUXLuD4nSRu=A@mail.gmail.com> <CAKJDb-PohuXrndPaUEMLpiepMysyRftRO0+eyDyjDGz0jSP8=g@mail.gmail.com>
Date 2014-12-08 12:47 +0530
Subject Re: Python re.search simple question
From Ganesh Pal <ganesh1pal@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16713.1418023071.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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@gmail.com
> wrote:

> On Mon, Dec 8, 2014 at 12:52 AM, Ganesh Pal <ganesh1pal@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
>

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


Thread

Re: Python re.search simple question Ganesh Pal <ganesh1pal@gmail.com> - 2014-12-08 12:47 +0530

csiph-web