Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
WOW, many thanks guys, Peter, and MRAB, for your time, help, and explanations! Peter, yes, you're right, when things get too complicated I should definitely try to split things up, and thus split the difficulties (ah, Descartes... ^^), thanks for the advice! MRAB, your code is now working,

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread MRAB
On 2017-02-26 17:15, michael.gauthier@gmail.com wrote: Hi MRAB, Thanks for taking time to look at my problem! I tried your solution: r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year old\s?)(?!son|daughter|kid|child))" but unfortunately it does seem not work. Also, I

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread Peter Otten
michael.gauthier@gmail.com wrote: > Hi MRAB, > > Thanks for taking time to look at my problem! > > I tried your solution: > > r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year > old\s?)(?!son|daughter|kid|child))" > > but unfortunately it does seem not work. Also, I

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
Hi MRAB, Thanks for taking time to look at my problem! I tried your solution: r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year old\s?)(?!son|daughter|kid|child))" but unfortunately it does seem not work. Also, I tried adding the negative lookaheads after every one of the

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread MRAB
On 2017-02-26 14:13, michael.gauthier@gmail.com wrote: Hi everyone, So here is my problem. I have a bunch of tweets and various metadata that I want to analyze for sociolinguistic purposes. In order to do this, I'm trying to infer users' ages thanks to the information they provide in