all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pascal Bourguignon <spam@thalassa.informatimago.com>
Subject: Re: match string to regexp
Date: 21 Nov 2003 07:56:16 +0100	[thread overview]
Message-ID: <87ptfmmcq7.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: m3oev6lv4n.fsf@defun.localdomain

Jesper Harder <harder@myrealbox.com> writes:

> Miguel Frasson <frasson@brutus.math.leidenuniv.nl> writes:
> 
> > How to match a string against a regexp? The string is returned by
> > some function like (match-string N).
> 
> ,----[ C-h f string-match RET ]
> | string-match is a built-in function.
> | (string-match REGEXP STRING &optional START)
> | 
> | Return index of start of first match for REGEXP in STRING, or nil.
> | Case is ignored if `case-fold-search' is non-nil in the current buffer.
> | If third arg START is non-nil, start search at that index in STRING.
> | For index of first char beyond the match, do (match-end 0).
> | `match-end' and `match-beginning' also give indices of substrings
> | matched by parenthesis constructs in the pattern.
> | 
> | You can use the function `match-string' to extract the substrings
> | matched by the parenthesis constructions in REGEXP.
> `----

  Time flies like an arrow.
  Fruit flies like a banana.

match-string returns the matched string.
string-match matches a string.

I  just miss  a function  to string  the matches,  and another  one to
return the stringed match...

-- 
__Pascal_Bourguignon__
http://www.informatimago.com/

      reply	other threads:[~2003-11-21  6:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20 18:49 match string to regexp Miguel Frasson
2003-11-20 19:04 ` Jesper Harder
2003-11-21  6:56   ` Pascal Bourguignon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ptfmmcq7.fsf@thalassa.informatimago.com \
    --to=spam@thalassa.informatimago.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.