fork download
  1. #include <stdio.h>
  2. #include <regex.h>
  3. #include <stdlib.h>
  4.  
  5. int main(){
  6.  
  7. regex_t regex;
  8. int reti;
  9. reti = regcomp(&regex, "([0-9a-fA-F]{8}( |$))+$", REG_EXTENDED);
  10. if (reti)
  11. {
  12. fprintf(stderr, "Could not compile regex\n");
  13. exit(1);
  14. }
  15.  
  16. reti = regexec(&regex, "00001206 ffffff00 00200800 00001044", 0, NULL, 0);
  17. if (!reti)
  18. {
  19. printf("Match");
  20. }
  21. else if (reti == REG_NOMATCH) {
  22. printf("No match bla bla\n");
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Match