all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: search for time stamp
  2003-09-21 14:12 search for time stamp Zimmen Gnauh
@ 2003-09-21 12:32 ` Dave Footitt
  2003-09-21 16:48   ` Zimmen Gnauh
  2003-09-21 17:13 ` Ehud Karni
  2003-09-28  9:42 ` Kai Grossjohann
  2 siblings, 1 reply; 6+ messages in thread
From: Dave Footitt @ 2003-09-21 12:32 UTC (permalink / raw)


On Sun, 21 Sep 2003 14:12:30 +0000, Zimmen Gnauh wrote:

>  use (re-search-forward "^??/??/?? ??:??:??:") to search for a

Replace each "?" in there with [0-9] and it should work.


Dave

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

* Re: search for time stamp
  2003-09-21 16:48   ` Zimmen Gnauh
@ 2003-09-21 13:36     ` Dave Footitt
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Footitt @ 2003-09-21 13:36 UTC (permalink / raw)



>    This works. But does ? cover all characters in [0-9]?

No, ? will match the preceeding expression once or not at all, it's
definitely not what you want in this case.


Dave

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

* search for time stamp
@ 2003-09-21 14:12 Zimmen Gnauh
  2003-09-21 12:32 ` Dave Footitt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zimmen Gnauh @ 2003-09-21 14:12 UTC (permalink / raw)



   use (re-search-forward "^??/??/?? ??:??:??:") to search for a
time stamp like the following
09/21/03 09:48:51: anything else
But it fails. Can anyone point out what is wrong? Thanks in advance. 

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

* Re: search for time stamp
  2003-09-21 12:32 ` Dave Footitt
@ 2003-09-21 16:48   ` Zimmen Gnauh
  2003-09-21 13:36     ` Dave Footitt
  0 siblings, 1 reply; 6+ messages in thread
From: Zimmen Gnauh @ 2003-09-21 16:48 UTC (permalink / raw)


Dave Footitt <dave@nospam.bogus.net> writes:

> On Sun, 21 Sep 2003 14:12:30 +0000, Zimmen Gnauh wrote:
> 
> >  use (re-search-forward "^??/??/?? ??:??:??:") to search for a
> 
> Replace each "?" in there with [0-9] and it should work.
> 
   This works. But does ? cover all characters in [0-9]?

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

* Re: search for time stamp
  2003-09-21 14:12 search for time stamp Zimmen Gnauh
  2003-09-21 12:32 ` Dave Footitt
@ 2003-09-21 17:13 ` Ehud Karni
  2003-09-28  9:42 ` Kai Grossjohann
  2 siblings, 0 replies; 6+ messages in thread
From: Ehud Karni @ 2003-09-21 17:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 21 Sep 2003 14:12:30 GMT, Zimmen Gnauh <yah00204052@yahoo.com> wrote:
>
>    use (re-search-forward "^??/??/?? ??:??:??:") to search for a
> time stamp like the following
> 09/21/03 09:48:51: anything else
> But it fails. Can anyone point out what is wrong? Thanks in advance.

Replace it with  (re-search-forward "^../../.. ..:..:..:")

Ehud.


- --
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE/bdwxLFvTvpjqOY0RAm4mAJ0cZCyLllz6kmMZNYDuD9MlRyx3mQCfZcfK
Di4J8zlXC97a66U/J1q1C0Q=
=GA1f
-----END PGP SIGNATURE-----

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

* Re: search for time stamp
  2003-09-21 14:12 search for time stamp Zimmen Gnauh
  2003-09-21 12:32 ` Dave Footitt
  2003-09-21 17:13 ` Ehud Karni
@ 2003-09-28  9:42 ` Kai Grossjohann
  2 siblings, 0 replies; 6+ messages in thread
From: Kai Grossjohann @ 2003-09-28  9:42 UTC (permalink / raw)


Zimmen Gnauh <yah00204052@yahoo.com> writes:

>    use (re-search-forward "^??/??/?? ??:??:??:") to search for a

That look like a shell glob.  In shell globs, ? stands for any single
character (except /), whereas * stands for zero or more characters
(except /).

Regular expressions work differently: . stands for any single
character (except newline), and ?, + and * are suffixes.

a? means zero or one occurrences of a.
a+ means one or more occurrences of a.
a* means zero or more occurrences of a.

Thus, ".*" means zero or more occurrences of any character, which is
similar to the shell glob "*".

And "." means any single character, which is similar to the shell glob
"?".

-- 
Two cafe au lait please, but without milk.

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

end of thread, other threads:[~2003-09-28  9:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-21 14:12 search for time stamp Zimmen Gnauh
2003-09-21 12:32 ` Dave Footitt
2003-09-21 16:48   ` Zimmen Gnauh
2003-09-21 13:36     ` Dave Footitt
2003-09-21 17:13 ` Ehud Karni
2003-09-28  9:42 ` Kai Grossjohann

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.