[BangPypers] A trivial doubt in negative lookbehind regular expression pattern
Neha Jain
neha.hbti.it at gmail.com
Wed Apr 6 13:09:29 CEST 2011
yeah.. thats possible.. thanks :)
On Tue, Apr 5, 2011 at 8:00 PM, Senthil Kumaran <orsenthil at gmail.com> wrote:
> On Tue, Apr 05, 2011 at 06:21:03PM +0530, Neha Jain wrote:
> > >
> > but the problem with this is that the line where I am searching for may
> be
> > like.. #define ABC_PG... so may be something for the start of the word
> type
> > matching may help.. \b?? i am not sure..
>
> The reason that second pattern is inclusive of the first one, makes it
> bit tricky.
>
> You can also consider to do it two steps with splitting the words and
> verify that simpler strings do not startswith 'ABC_' pattern.
>
>
> >>> for each in re.split('\W','#define ABC_CDF\nAB_CDF'):
> ['', 'define', 'ABC_CDF', 'AB_CDF']
>
> --
> Senthil
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
--
Smiles
Neha )))))
More information about the BangPypers
mailing list