summaryrefslogtreecommitdiffhomepage
path: root/examples/regex1.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/regex1.c')
-rw-r--r--examples/regex1.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/examples/regex1.c b/examples/regex1.c
deleted file mode 100644
index 9b450453..00000000
--- a/examples/regex1.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stc/cstr.h>
-#include <stc/cregex.h>
-
-int main()
-{
- c_auto (cstr, input)
- c_auto (cregex, float_expr)
- {
- float_expr = cregex_new("[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)");
- // Until "q" is given, ask for another number
- while (true)
- {
- printf("Enter float number (q for quit): ");
- cstr_getline(&input, stdin);
-
- // Exit when the user inputs q
- if (cstr_equals(input, "q"))
- break;
-
- if (cregex_is_match(&float_expr, input.str))
- printf("Input is a float\n");
- else
- printf("Invalid input : Not a float\n");
- }
- }
-} \ No newline at end of file