[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I can't believe: replace regexp in a string

From: Stefan Kamphausen
Subject: Re: I can't believe: replace regexp in a string
Date: 17 Feb 2003 03:24:08 -0800

Hi, (Kai Gro├čjohann wrote in message 
> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]