If it's not homework, you shouldn't be using REs. The following C code should be a good start.
#include <stdio.h>
int isPandigital (char *inputStr) {
/* Initial used states of false. */
char used[] = {0,0,0,0,0,0,0,0,0,0};
int count = 0;
char ch;
/* Process each character in string. */
while ((ch = *inputStr++) != '\0') {
/* Non-numeric, bad. */
if ((ch < '0') || (ch > '9')) {
return 0;
}
/* Too many, bad. */
if (++count > 9) {
return 0;
}
/* Multiples, bad. */
if (used[ch - '0']) {
return 0;
}
/* Store fact that this one's been used. */
used[ch - '0'] = 1;
}
/* Good or bad depending on how many we've had. */
return (count == 9);
}
int main (int argCount, char *argVar[]) {
int i;
for (i = 1; i < argCount; i++) {
if (isPandigital (argVar[i])) {
printf ("'%s' is pandigital\n", argVar[i]);
} else {
printf ("'%s' is NOT pandigital\n", argVar[i]);
}
}
return 0;
}
Using your test data:
$ pandigital 123456789 891364572 11234556789 25896471
we get the following results:
'123456789' is pandigital
'891364572' is pandigital
'11234556789' is NOT pandigital
'25896471' is NOT pandigital