Diffstat (limited to 'build-aux/zipre')
1 files changed, 37 insertions, 0 deletions
diff --git a/build-aux/zipre b/build-aux/zipre
new file mode 100755
@@ -0,0 +1,37 @@
+ * Given a set of sorted zips, generates a regular expression to match only the
+ * given input
+ * Copyright (C) 2016 R-T Specialty, LLC.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * I wanted to write this in Scheme (it's a perfect recursive application), but
+ * I figured that other developers may get annoyed having to find a Scheme impl
+ * that works for them...so...PHP it is...
+ * THIS SCRIPT EXPECTS THE DATA TO BE SORTED! This can be easily accomplished by
+ * doing the following:
+ * sort -d zipfile | ./zipre
+// grab input from stdin (must be sorted!)
+$data = explode( "\n", file_get_contents( 'php://stdin' ) );
+// build and output
+echo gen_re_quick( $data );