
#include <sys/types.h>
#include <regex.h>
#include <stdio.h>
#include <gregex.h>



int main(int argc, char**argv){

  if(argc<2) { printf( "parameter - test string\n"); return 1; }
  char * str = argv[1];
  gregex reg;
  reg.compile("^.*%[0-9]*[dioux].*%[0-9]*[dioux].*%[0-9]*[dioux].*%[0-9]*s", gregex::icase /*| gregex::newline*/ );
  if (!reg.match(str))
  {
    printf("ST_EDITSTATUS have wrong format. Read NOTEWORK.TXT for details or announce author if this error is false positive.");
  }

}

/*
int main(int argc, char**argv){
  regex_t  preg;
  int rc;
  char errstring[101];
  if(argc<3) { printf( "1st par - regexp, 2nd par - test string\n"); return 1; }
  rc=regcomp( &preg, argv[1], REG_ICASE | REG_NOSUB );
  if(rc){
    regerror(rc, &preg, errstring, sizeof(errstring));
    printf("regcomp() error: %s\n", errstring);
    return 1;
  }else printf("regcomp() OK\n");
  rc=regexec( &preg, argv[2], 0, NULL, 0 );
  if(rc){
    regerror(rc, &preg, errstring, sizeof(errstring));
    printf("regexec() error: %s\n", errstring);
    regfree(&preg);
    return 1;
  }else  printf("regexec() match\n");
  regfree(&preg);
  return 0;
}
*/
