aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/nat/test_regexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/nat/test_regexp.c')
-rw-r--r--contrib/nat/test_regexp.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c
deleted file mode 100644
index 808a703ca..000000000
--- a/contrib/nat/test_regexp.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* make test_regexp */
-#include <sys/types.h>
-#include <regex.h>
-#include <stdio.h>
-
-
-int main(int argc, char **argv)
-{
- regex_t reg;
- regmatch_t matches[2];
-
- if (argc != 4) {
- printf("Invoke with: test_regexp REGEXP REPLACE NR\n");
- return -1;
- }
-
- if (regcomp(&reg, argv[1], REG_EXTENDED) != 0) {
- fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]);
- return -1;
- }
-
- if (regexec(&reg, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1)
- printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]);
- else
- printf("No match.\n");
-
- regfree(&reg);
-
- return 0;
-}