Re: The Regex Story

2010-04-10 Thread Dotan Cohen
> Unreasonable phobia to regex is just as much harmful as overuse of it. > Agreed. I did not mean to sound as if I am against the use of regular expressions. -- Dotan Cohen http://bido.com http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: The Regex Story

2010-04-09 Thread Tim Chase
On 04/09/2010 06:18 AM, Stefan Behnel wrote: Tim Chase, 08.04.2010 16:23: Lie Ryan wrote: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some people ... regex ... t

Re: The Regex Story

2010-04-09 Thread Stefan Behnel
Steven D'Aprano, 09.04.2010 10:59: It's as if we decided that every maths problem had to be solved by a single expression, no matter how complex, and invented a painfully terse language unrelated to normal maths syntax for doing so: # Calculate the roots of sin**2(3*x-y): result = me.compile("{^

Re: The Regex Story

2010-04-09 Thread Stefan Behnel
Tim Chase, 08.04.2010 16:23: Lie Ryan wrote: Why am I seeing a lot of this pattern lately: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some people ... regex ...

Re: The Regex Story

2010-04-09 Thread Lie Ryan
On 04/09/10 18:59, Steven D'Aprano wrote: > On Fri, 09 Apr 2010 14:48:22 +1000, Lie Ryan wrote: > >> On 04/09/10 12:32, Dotan Cohen wrote: Regexes do have their uses. It's a case of knowing when they are the best approach and when they aren't. >>> >>> Agreed. The problems begin when the

Re: The Regex Story

2010-04-09 Thread Paul Rubin
Steven D'Aprano writes: > One disadvantage is that you have to learn an entire new language, a > language which is painfully terse and obfuscated, with virtually no > support for debugging. Larry Wall has criticised the Perl regex syntax on > a number of grounds: ... There is a parser combinat

Re: The Regex Story

2010-04-09 Thread Alf P. Steinbach
* Steven D'Aprano: For some reason, people seem to have the idea that pattern matching of strings must be a single expression, no matter how complicated the pattern they're trying to match. If we have a complicated task to do in almost any other field, we don't hesitate to write a function to

Re: The Regex Story

2010-04-09 Thread Steven D'Aprano
On Fri, 09 Apr 2010 14:48:22 +1000, Lie Ryan wrote: > On 04/09/10 12:32, Dotan Cohen wrote: >>> Regexes do have their uses. It's a case of knowing when they are the >>> best approach and when they aren't. >> >> Agreed. The problems begin when the "when they aren't" is not >> recognised. > > But

Re: The Regex Story

2010-04-08 Thread Patrick Maupin
On Apr 8, 9:32 pm, Dotan Cohen wrote: > > Regexes do have their uses. It's a case of knowing when they are the > > best approach and when they aren't. > > Agreed. The problems begin when the "when they aren't" is not recognised. Arguing against this is like arguing against motherhood and apple pi

Re: The Regex Story

2010-04-08 Thread Lie Ryan
On 04/09/10 12:32, Dotan Cohen wrote: >> Regexes do have their uses. It's a case of knowing when they are the >> best approach and when they aren't. > > Agreed. The problems begin when the "when they aren't" is not recognised. But problems also arises when people are suggesting overly complex ser

Re: The Regex Story

2010-04-08 Thread Dotan Cohen
> Regexes do have their uses. It's a case of knowing when they are the > best approach and when they aren't. > Agreed. The problems begin when the "when they aren't" is not recognised. -- Dotan Cohen http://bido.com http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

Re: The Regex Story

2010-04-08 Thread MRAB
Dotan Cohen wrote: I would have agreed with you if someone were to make the statement until a few weeks ago; somehow in the last week or so, the mood about regex seems to has shifted to "regex is not suitable for anything" type of mood. As soon as someone (OP or not) proposed a regex solution, so

Re: The Regex Story

2010-04-08 Thread Dotan Cohen
> I would have agreed with you if someone were to make the statement > until a few weeks ago; somehow in the last week or so, the mood about > regex seems to has shifted to "regex is not suitable for anything" > type of mood. As soon as someone (OP or not) proposed a regex > solution, someone else

Re: The Regex Story

2010-04-08 Thread Lie Ryan
On 4/9/10, Tim Chase wrote: > Lie Ryan wrote: >> Why am I seeing a lot of this pattern lately: >> >> OP: Got problem with string >> +- A: Suggested a regex-based solution >>+- B: Quoted "Some people ... regex ... two problems." >> >> or >> >> OP: Writes some regex, found problem >> +- A: Quote

Re: The Regex Story

2010-04-08 Thread Tim Chase
Lie Ryan wrote: Why am I seeing a lot of this pattern lately: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some people ... regex ... two problems." +- B: Sup

The Regex Story

2010-04-07 Thread Lie Ryan
On 04/08/10 12:45, Patrick Maupin wrote: > (And I got testy because of seeing other IMO unwarranted denigration > of re on the list lately.) Why am I seeing a lot of this pattern lately: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... r