all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* re-search-backward bug
@ 2002-10-08 14:52 Tom Wurgler
  2002-10-08 16:05 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Wurgler @ 2002-10-08 14:52 UTC (permalink / raw)
  Cc: t901353

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (hppa2.0w-hp-hpux11.00, Motif Version 2.1.0)
 of 2002-06-28 on rds294
configured using `configure  --cache-file=/dev/null --prefix=/home/rdstt1/t901353/local --x-includes=/usr/include/X11R6:/usr/contrib/X11R6/include --x-libraries=/usr/lib/X11R6:/usr/contrib/X11R6/lib --with-x-toolkit=motif'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

1) Have a decimal number in a buffer, for example:

1234.456

2) Have your cursor BEFORE the number
3) Do esc-x re-search-forward "[0-9]*\.[0-9]*"
   The complete number "1234.456" is found.
4) Now have the cursor start AFTER the number
5) Do esc-x re-search-backward "[0-9]*\.[0-9]*"
   It only matches back to the ".", specifically ".456"  

Why is going backward different than going forward?

Thanks for your help.
Tom


============================================================================
Tom Wurgler                             The Goodyear Tire & Rubber Company
Principal Engineer                      Tire-Vehicle Engineering Technology
Phone:         330-796-1656             Technical Center D/460G            
Fax:           330-796-3292             P.O.Box 3531                       
internet mail: twurgler@goodyear.com    Akron, Ohio 44309-3531             
============================================================================


Recent input:
C-s C-w C-w C-s C-s C-s C-s C-s C-a <up> <C-up> C-s 
d i r e c C-s C-s C-s C-s C-s C-s C-a <f11> r o <backspace> 
h o w z SPC a b o u t SPC s u b w a y ? <return> C-c 
C-c x <f11> d d q <next> <f11> d q C-s C-s C-s C-s 
C-s C-s C-s C-s C-a C-x m e m a C-c k C-x m C-c k <escape> 
x e m a c s SPC b u SPC C-a r e p o r t - <tab> SPC 
<return>

Recent messages:
1 new message read
No following nondeleted message
Expunging deleted messages...done
Saving file /home/rdstt1/t901353/.rmail...
Wrote /home/rdstt1/t901353/.rmail

Mark saved where search started
Fontifying *mail*... (regexps........)
Fontifying *mail*... (regexps........)
Loading emacsbug...done

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: re-search-backward bug
  2002-10-08 14:52 re-search-backward bug Tom Wurgler
@ 2002-10-08 16:05 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2002-10-08 16:05 UTC (permalink / raw)
  Cc: bug-gnu-emacs, t901353

Tom Wurgler <twurgler@goodyear.com> writes:

|> 1) Have a decimal number in a buffer, for example:
|> 
|> 1234.456
|> 
|> 2) Have your cursor BEFORE the number
|> 3) Do esc-x re-search-forward "[0-9]*\.[0-9]*"
|>    The complete number "1234.456" is found.
|> 4) Now have the cursor start AFTER the number
|> 5) Do esc-x re-search-backward "[0-9]*\.[0-9]*"
|>    It only matches back to the ".", specifically ".456"  
|> 
|> Why is going backward different than going forward?

Because matching by regexp is an inherently forward going operation.  It
is (conceptionally) implemented by going character by character until the
regexp matches.  That means that when going backwards the first match is
actually the _last_ match when viewed in the forward direction.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-08 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-08 14:52 re-search-backward bug Tom Wurgler
2002-10-08 16:05 ` Andreas Schwab

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.