unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jesper Harder <harder@myrealbox.com>
Subject: Re: match string to regexp
Date: Thu, 20 Nov 2003 20:04:08 +0100	[thread overview]
Message-ID: <m3oev6lv4n.fsf@defun.localdomain> (raw)
In-Reply-To: gyptfm50zw.fsf@brutus.math.leidenuniv.nl

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.
`----

  reply	other threads:[~2003-11-20 19:04 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 [this message]
2003-11-21  6:56   ` Pascal Bourguignon

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m3oev6lv4n.fsf@defun.localdomain \
    --to=harder@myrealbox.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).