From: kamphausen@creativepharma.com (Stefan Kamphausen)
Subject: Re: I can't believe: replace regexp in a string
Date: 17 Feb 2003 03:24:08 -0800 [thread overview]
Message-ID: <62ede926.0302170324.70a32fc2@posting.google.com> (raw)
In-Reply-To: 848ywhv3jg.fsf@lucy.is.informatik.uni-duisburg.de
Hi,
kai.grossjohann@uni-duisburg.de (Kai Großjohann wrote in message news:<848ywhv3jg.fsf@lucy.is.informatik.uni-duisburg.de>...
> Generally, when parsing a text file it is often better to use general
> movement functions rather than to rely on regular expressions.
> (Sometimes, regexes are the right tool even in Emacs. But in Perl, a
> regex is ALWAYS the right solution, in Emacs it SELDOM is.)
>
> For example, you could frob the syntax correctly and then what you're
> looking for might be a word, or a string, or an s-expression.
>
> In your specific case, if you use searching in the buffer to find the
> right spot, then you can use skip-syntax-backward or
> skip-chars-backward to skip backwards over the trailing spaces.
> Problem solved :-)
Yes, I think I needed someone to point me to the fact that an lispish
approach is probably different to a perlish one :-)
Actually yesterday in the evening I managed to rewrite that parser and
it now works in both Emacsen and doesn't need the replace-in-string
anymore :-)
More than that, the code is much cleaner now.
Thanks and Regards
stefan kamphausen
prev parent reply other threads:[~2003-02-17 11:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-14 8:37 I can't believe: replace regexp in a string Stefan Kamphausen
2003-02-14 9:04 ` Klaus Berndl
2003-02-14 9:11 ` David Kastrup
2003-02-14 15:55 ` Stefan Monnier <foo@acm.com>
2003-02-15 15:07 ` Stefan Kamphausen
2003-02-15 17:48 ` Kai Großjohann
2003-02-17 11:24 ` Stefan Kamphausen [this message]
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=62ede926.0302170324.70a32fc2@posting.google.com \
--to=kamphausen@creativepharma.com \
/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).