regmatch_t rm[2]; int n;
regmatch_t rm[4]; int n, i, ret = 0;
main (void){  regex_t re;  regmatch_t rm[2];  int n;  mtrace ();  n = regcomp (&re, "[^~]*~", 0);  if (n != 0)    {      char buf[500];      regerror (n, &re, buf, sizeof (buf));      printf ("regcomp failed: %s\n", buf);      exit (1);    }  if (regexec (&re, "\nx~y", 2, rm, 0))    {      puts ("regexec failed");      exit (2);    }  if (rm[0].rm_so != 0 || rm[0].rm_eo != 3)    {      printf ("regexec match failure: %d %d\n",	      rm[0].rm_so, rm[0].rm_eo);      exit (3);    }  regfree (&re);  return 0;}