sus-regex/test.c

20 lines
365 B
C
Raw Normal View History

2024-04-04 07:37:18 +03:00
#include <amogus.h>
2024-04-04 09:23:46 +03:00
#include <stdio.h>
2024-04-04 20:18:10 +03:00
#include <stdlib.h>
#include <memory.h>
void callback(char* str, int size, void* data) {
char** out = (char**)data;
*out = (char*)malloc(size);
2024-04-05 10:21:27 +03:00
if(str!=NULL)
memcpy(*out, str, size);
else abort();
2024-04-04 20:18:10 +03:00
}
2024-04-04 07:37:18 +03:00
int main() {
2024-04-04 09:23:46 +03:00
char* match;
2024-04-05 10:21:27 +03:00
if(!entry("me\\|\\|ow.*|m(r(r(p..*)))",callback,&match))
2024-04-04 09:23:46 +03:00
return 1;
printf("%s",match);
2024-04-04 07:37:18 +03:00
}