comparison lib/regex-quote.c @ 14409:ee532a615968

regex-quote: Fix creation of POSIX extended regular expressions. * lib/regex-quote.c (ere_special): Add grouping and alternation operators.
author Bruno Haible <bruno@clisp.org>
date Sun, 06 Mar 2011 14:25:49 +0100
parents 97fc9a21a8fb
children 0a972f366396
comparison
equal deleted inserted replaced
14408:3d18c39304e4 14409:ee532a615968
27 27
28 /* Characters that are special in a BRE. */ 28 /* Characters that are special in a BRE. */
29 static const char bre_special[] = "$^.*[]\\"; 29 static const char bre_special[] = "$^.*[]\\";
30 30
31 /* Characters that are special in an ERE. */ 31 /* Characters that are special in an ERE. */
32 static const char ere_special[] = "$^.*[]\\+?()"; 32 static const char ere_special[] = "$^.*[]\\+?{}()|";
33 33
34 size_t 34 size_t
35 regex_quote_length (const char *string, int cflags) 35 regex_quote_length (const char *string, int cflags)
36 { 36 {
37 const char *special = (cflags != 0 ? ere_special : bre_special); 37 const char *special = (cflags != 0 ? ere_special : bre_special);