Re: RE newbie question

2018-04-18 Thread Steven D'Aprano
On Wed, 18 Apr 2018 12:37:29 -0700, TUA wrote: > My intention is to implement a max. length of 8 for an input string. The > above works well in all other respects, but does allow for strings that > are too long. if len(input_string) > 8: raise ValueError('string is too long') -- Steve --

Re: RE newbie question

2018-04-18 Thread Albert-Jan Roskam
On Apr 18, 2018 21:42, TUA wrote: > > import re > > compval = 'A123456_8' > regex = '[a-zA-Z]\w{0,7}' > > if re.match(regex, compval): >print('Yes') > else: >print('No') > > > My intention is to implement a max. length of 8 for an input string. The > above works well in all other respect

Re: RE newbie question

2018-04-18 Thread TUA
Thanks much! -- https://mail.python.org/mailman/listinfo/python-list

Re: RE newbie question

2018-04-18 Thread Ian Kelly
On Wed, Apr 18, 2018 at 1:57 PM, Rob Gaddi wrote: > On 04/18/2018 12:37 PM, TUA wrote: >> >> import re >> >> compval = 'A123456_8' >> regex = '[a-zA-Z]\w{0,7}' >> >> if re.match(regex, compval): >> print('Yes') >> else: >> print('No') >> >> >> My intention is to implement a max. length of

Re: RE newbie question

2018-04-18 Thread Rob Gaddi
On 04/18/2018 12:37 PM, TUA wrote: import re compval = 'A123456_8' regex = '[a-zA-Z]\w{0,7}' if re.match(regex, compval): print('Yes') else: print('No') My intention is to implement a max. length of 8 for an input string. The above works well in all other respects, but does allow for

Re: [Re: newbie question]

2004-12-22 Thread Doug Holton
Ed Leafe wrote: You've missed the obvious: it's 'criticism' or 'observation' when it comes from Doug, but it's a 'flame' when it is directed at Doug. > Unless there is something more substantial then whining, howzabout we all just ignore it and let it die a quick death? It's amazing how m

Re: [Re: newbie question]

2004-12-22 Thread Doug Holton
Steve Holden wrote: > 'Scuse me? This group has a long history of off-topic posting, and > anyway who decided that CPython should be the exclusive focus? Even > on-topic we can talk about Jython and PyPy as well as CPython. > > Off-topic we can talk about what we damned well please. Even boo :-) Th

Re: [Re: newbie question]

2004-12-22 Thread Steve Holden
Doug Holton wrote: Reinhold Birkenfeld wrote: Doug Holton wrote: Peter Hansen wrote: As a result of all the activity in the "Boo who?" thread, however, that you started Apart from that it is considered disrespectful to put your "opponent's" name into the subject, this flame war is biting its tail

Re: [Re: newbie question]

2004-12-22 Thread Ed Leafe
On Dec 22, 2004, at 11:38 AM, Reinhold Birkenfeld wrote: Apart from that it is considered disrespectful to put your "opponent's" name into the subject, this flame war is biting its tail already. You've missed the obvious: it's 'criticism' or 'observation' when it comes from Doug, but it's a 'flam

Re: [Re: newbie question]

2004-12-22 Thread Doug Holton
Reinhold Birkenfeld wrote: Doug Holton wrote: Peter Hansen wrote: As a result of all the activity in the "Boo who?" thread, however, that you started Apart from that it is considered disrespectful to put your "opponent's" name into the subject, this flame war is biting its tail already. So putting

Re: [Re: newbie question]

2004-12-22 Thread Reinhold Birkenfeld
Doug Holton wrote: > Peter Hansen wrote: >> Luis M. Gonzalez wrote: >> >>> As far as I could see, everythime the word "boo" is typed, some sort of >>> censorship or plain bashing comes up, and I think this is not fair. >> >> I think doing this by defending Doug's postings, however, might weaken >>