entered into RCS
This commit is contained in:
parent
5814274441
commit
e59a84533d
1 changed files with 19 additions and 0 deletions
19
src/search.c
19
src/search.c
|
@ -227,6 +227,25 @@ matched by parenthesis constructs in the pattern.")
|
|||
if (val < 0) return Qnil;
|
||||
return make_number (val);
|
||||
}
|
||||
|
||||
/* Match REGEXP against STRING, searching all of STRING,
|
||||
and return the index of the match, or negative on failure.
|
||||
This does not clobber the match data. */
|
||||
|
||||
int
|
||||
fast_string_match (regexp, string)
|
||||
Lisp_Object regexp, string;
|
||||
{
|
||||
int val;
|
||||
|
||||
compile_pattern (regexp, &searchbuf, 0, 0);
|
||||
immediate_quit = 1;
|
||||
val = re_search (&searchbuf, (char *) XSTRING (string)->data,
|
||||
XSTRING (string)->size, 0, XSTRING (string)->size,
|
||||
0);
|
||||
immediate_quit = 0;
|
||||
return val;
|
||||
}
|
||||
|
||||
/* Search for COUNT instances of the character TARGET, starting at START.
|
||||
If COUNT is negative, search backwards.
|
||||
|
|
Loading…
Add table
Reference in a new issue