git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] grep: don't call regexec() for fixed strings

From
Alex Riesen <raa.lkml@gmail.com>
Date
Jan 12, 2009, 15:32 UTC
Message-ID
<81b0412b0901120732t1bd1978awdc4be47767e02863@mail.gmail.com>
In-Reply-To
<4967DB4A.2000702@lsrfire.ath.cx>
2009/1/10 René Scharfe <rene.scharfe@lsrfire.ath.cx>:
Show 12 quoted lines
> +static int isregexspecial(int c)
> +{
> +       return isspecial(c) || c == '$' || c == '(' || c == ')' || c == '+' ||
> +                              c == '.' || c == '^' || c == '{' || c == '|';
> +}
> +
> +static int is_fixed(const char *s)
> +{
> +       while (!isregexspecial(*s))
> +               s++;
> +       return !*s;
> +}
strchr?
Previous: Johannes SchindelinNext: René Scharfe
Message 6 of 12 in “grep -w: forward to next possible position after rejected match”
  1. 1/2 grep -w: forward to next possible position after rejected matchRené Scharfe, Jan 9, 2009
  2. 2/2 grep: don't call regexec() for fixed stringsRené Scharfe, Jan 9, 2009
  3. Junio C HamanoJan 10, 2009
  4. Mikael MagnussonJan 12, 2009
  5. Johannes SchindelinJan 12, 2009
  6. Alex RiesenJan 12, 2009
  7. René ScharfeJan 12, 2009
  8. Junio C HamanoJan 13, 2009
  9. 1/4 Add ctype testRené Scharfe, Jan 17, 2009
  10. 2/4 Reformat ctype.cRené Scharfe, Jan 17, 2009
  11. 3/4 Change NUL char handling of isspecial()René Scharfe, Jan 17, 2009
  12. 4/4 Add is_regex_special()René Scharfe, Jan 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.