These are undefined escape sequences by the standard, but often
used in sed scripts.
s--;
break;
case '{':
+ case '+':
+ case '?':
+ /* extension: treat \+, \? as repetitions in BRE */
/* reject repetitions after empty expression in BRE */
if (!ere)
return REG_BADRPT;
}
if (*s=='\\' && ere)
break;
- if (*s=='\\' && s[1]!='{')
+ /* extension: treat \+, \? as repetitions in BRE */
+ if (*s=='\\' && s[1]!='+' && s[1]!='?' && s[1]!='{')
break;
if (*s=='\\')
s++;