[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Searching for a string in a string
From: |
Pascal J. Bourguignon |
Subject: |
Re: Searching for a string in a string |
Date: |
Mon, 28 Sep 2009 15:08:51 +0200 |
User-agent: |
Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux) |
Joost Kremers <joostkremers@yahoo.com> writes:
> Nordlöw wrote:
>> Is there a variant of string-match() that searches for a string (sub-
>> string) instead of a regexp?
>
> a string is just a special case of a regexp, so why wouldn't you use
> string-match?
A primitive literal-string-match could be more efficient than a
generic regular expression matching algorithm. That said, if the
regexp machinery is well optimized, we only lose regexp compilation
time, which in the case of a fully escaped regular expression may be
very fast.
--
__Pascal Bourguignon__