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

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

Re: regexp-builder shows matches, re-search-forward fails?


From: Thorsten Jolitz
Subject: Re: regexp-builder shows matches, re-search-forward fails?
Date: Thu, 26 Jul 2012 13:23:37 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux)

Thorsten Jolitz <tjolitz@googlemail.com> writes:

> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> Check you `point'.  Is it already past the matches?
>
> No, I use (goto-char (point-min)) before the re-search-forward. And I
> print out the (current-buffer in the function - its the right one). 
>
> BTW its a temp buffer - but that shouldn't matter, right? 

More concrete:

,-------------------------
| \\(^# Task: \\)\\(.*$\\)
`-------------------------

does match both tasks in 

,----------------------
| # Task: A+B
| 
| (+ (read) (read))
| 3 4
| -> 7
| 
| 
| # Task: Abstract type
`----------------------

in regexp-builder, but 

,------------------------------------------------
| (re-search-forward  "\\(^# Task: \\)\\(.*$\\)")
`------------------------------------------------

with point at beginning of that buffer gives 'search-failed'. 

Thats strange.
(I tried \( and \\\\( for escaping too, but to no avail)

-- 
cheers,
Thorsten




reply via email to

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