/* globals */
/* options */
-static int be_quiet = 0, in_place=0;
+static int be_quiet = 0, in_place=0, regex_type=0;
FILE *nonstdout;
char *outname;
temp=copy_parsing_slashn(pos,next);
*regex = (regex_t *) xmalloc(sizeof(regex_t));
- xregcomp(*regex, temp, REG_NEWLINE);
+ xregcomp(*regex, temp, regex_type|REG_NEWLINE);
free(temp);
/* Move position to next character after last delimiter */
pos+=(next+1);
static int parse_subst_cmd(sed_cmd_t * const sed_cmd, char *substr)
{
- int cflags = 0;
+ int cflags = regex_type;
char *match;
int idx = 0;
#endif
/* do normal option parsing */
- while ((opt = getopt(argc, argv, "ine:f:")) > 0) {
+ while ((opt = getopt(argc, argv, "irne:f:")) > 0) {
switch (opt) {
case 'i':
in_place++;
atexit(cleanup_outname);
break;
+ case 'r':
+ regex_type|=REG_EXTENDED;
+ break;
case 'n':
be_quiet++;
break;