-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
41 lines (33 loc) · 826 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdlib.h>
#include <stdio.h>
#include "regex.h"
#define TEST_MATCH(s, p) do {\
{\
int res = regex_match(s, p);\
printf("%s -> %s = %d\n", s, p, res);\
} \
} while (0)
/**
* main - Entry point
*
* Return: EXIT_SUCCESS or EXIT_FAILURE
*/
int main(void)
{
TEST_MATCH("H", "H");
TEST_MATCH("HH", "H");
TEST_MATCH("HH", "H*");
TEST_MATCH("HHHHHHHHHHHHHHHHH", "H*");
TEST_MATCH("Holberton", ".*");
TEST_MATCH("Alex", ".*");
TEST_MATCH("Guillaume", ".*");
TEST_MATCH("Julien", ".*");
TEST_MATCH("Holberton", "Z*H.*");
TEST_MATCH("Holberton", "Z*H.*olberton");
TEST_MATCH("Holberton", "Z*H.*o.");
TEST_MATCH("Holberton", "Z*H.*o");
TEST_MATCH("Holberton", "holberton");
TEST_MATCH("Holberton", ".olberton");
TEST_MATCH("!H@o#l$b%e^r&t(o)n_", "!.@.#.$.%.^.&.(.)._");
return (EXIT_SUCCESS);
}