help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Strange behavior in search-forward-regexp?


From: Mathias Dahl
Subject: Re: Strange behavior in search-forward-regexp?
Date: Sat, 11 Feb 2006 22:43:17 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Peter Dyballa <Peter_Dyballa@web.de> writes:

> I've seen the same behaviour of search-forward-regexp "^[^;]+;.*text"
> a few times, wrapping around into the next line. It's obvious that
> newline is not semicolon, so it complies with the search regexp. I
> have no better advice than to use a non-discriminating regexp, i.e.
> search for a set of real characters.

The solution was easy:

(defun test3 ()
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (if (search-forward-regexp "^[^\n.;]+;.*test1" nil t)
        (message (match-string-no-properties 0)))))

Thanks for the hint, you just fixed a bug in tumme! :)



reply via email to

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