HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Using PCRE to check regexps passed to Apache
[hcoop/domtool2.git]
/
pcre
/
pcre_sml.c
diff --git a/pcre/pcre_sml.c
b/pcre/pcre_sml.c
new file mode 100644
(file)
index 0000000..
48998ba
--- /dev/null
+++ b/
pcre/pcre_sml.c
@@ -0,0
+1,15
@@
+#include <pcre.h>
+
+int PCRE_SML_validRegexp(const char *s) {
+ pcre *re;
+ const char *error;
+ int erroffset;
+
+ re = pcre_compile(s, 0, &error, &erroffset, NULL);
+
+ if (re) {
+ pcre_free(re);
+ return 1;
+ } else
+ return 0;
+}