From: John Withers <grayarea@reddagger.org>
To: Tim X <timx@nospam.dev.null>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Perl, etc has these "?"-prefix modifiers/codes/whatever. Precisely which does emacs have (and NOT have)?
Date: Sat, 20 Feb 2010 13:14:25 -0800 [thread overview]
Message-ID: <1266700465.7034.128.camel@Frank-Brain> (raw)
In-Reply-To: <87d40167r2.fsf@lion.rapttech.com.au>
Tim,
You are completely correct on all counts. What I should have said was
that for many classes of problems I run into during my daily work the
ability to write a regex is much faster than using a parser (and
definitely than writing one). And that I find the classes of problems
that fit that mold increased by having lookahead/behind assertions.
I use parsers more frequently than I use regexes, but a lot of the one
shot work I do on logs, semi-structured text files of various types and
in very, very limited cases some html where the html is already
processed in some way; a quick regex is much faster for me, and I
imagine almost everyone, but I could be wrong.
But in reality, as you pointed out, I shouldn't have been in the
discussion at all. Next week I am going to have time to look at Tomohiro
Matsuyamas patch that I referenced in the first of my posts in this
string. My comments should have been restricted to just saying that I am
looking forward to doing so.
Thank you for pointing this out.
john withers
On Fri, 2010-02-19 at 17:48 +1100, Tim X wrote:
> John Withers <grayarea@reddagger.org> writes:
>
> > On Fri, 2010-02-19 at 02:06 +0100, Pascal J. Bourguignon wrote:
> >
> >>
> >> One difficulty when you try to extend regular expression is that the
> >> time and space complexity of matching such an extended regular
> >> expression easily becomes exponential. In these cases, it may be easier
> >> to write a parser, than to try to force it thru regular expressions,
> >> both for the programmer's brain and for the CPU processor...
> >
> > Sure exponential backtracking can happen, you can write checks for
> > common cases and aborts, but let's say you don't. Who cares? I can write
> > things that go exponential for memory or clock ticks in any of the
> > languages I am even trivially familiar with.
> >
> >> Otherwise, people will do anything they want to do, theory and
> >> precendent nonobstant. This only demonstrate the lack of culture of the
> >> newcomers.
> >
> > Or it demonstrates the need to get things done. I can write a regex to
> > do a transform on 1000 text files in a directory and do the operation
> > before you have closed the last paren on your parser.
> >
>
> I'm always amazed at these sort of claims because they are just so
> meaningless. for every concrete example you can come up with, we can
> come up with others where writing the parser will be faster and more
> reliable than using REs.
<snip>
>
> Posts like "Plese, someone else do something that I want" rarely
> achieves anything other than make readers think its just a moan from
> someone who is frustrated but not frustrated enough to do anything about
> their problem except moan. While its fine to be lazy, being lazy and
> fussy is just a recipie to make one miserable. Being lazy, fussy and a
> moaner just adds noise that makes it harder to find relevant
> information.
>
> Tim
>
>
next prev parent reply other threads:[~2010-02-20 21:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 6:10 Perl, etc has these "?"-prefix modifiers/codes/whatever. Precisely which does emacs have (and NOT have)? David Combs
2010-02-18 11:46 ` Pascal J. Bourguignon
2010-02-18 16:57 ` John Withers
[not found] ` <mailman.1450.1266512270.14305.help-gnu-emacs@gnu.org>
2010-02-18 19:02 ` Pascal J. Bourguignon
2010-02-18 21:38 ` John Bokma
2010-02-18 21:42 ` John Withers
[not found] ` <mailman.1460.1266529372.14305.help-gnu-emacs@gnu.org>
2010-02-19 0:53 ` David Combs
2010-02-19 1:06 ` Pascal J. Bourguignon
2010-02-19 2:36 ` John Withers
[not found] ` <mailman.1470.1266547034.14305.help-gnu-emacs@gnu.org>
2010-02-19 6:48 ` Tim X
2010-02-20 21:14 ` John Withers [this message]
[not found] ` <mailman.1559.1266700478.14305.help-gnu-emacs@gnu.org>
2010-02-23 12:33 ` Tim Landscheidt
2010-02-18 16:23 ` Tyler Smith
[not found] ` <mailman.1449.1266510261.14305.help-gnu-emacs@gnu.org>
2010-02-19 0:59 ` David Combs
2010-02-19 3:22 ` Tyler Smith
2010-02-24 19:54 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266700465.7034.128.camel@Frank-Brain \
--to=grayarea@reddagger.org \
--cc=help-gnu-emacs@gnu.org \
--cc=timx@nospam.dev.null \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).