--- /dev/null
+/* $Id$ */
+#include <iostream>
+#include <string>
+#include "regex.h"
+
+using namespace std;
+using namespace Msp;
+
+int main(int argc, char **argv)
+{
+ if(argc<2)
+ {
+ cerr<<"Usage: "<<argv[0]<<" <regex>\n";
+ return 1;
+ }
+
+ Regex regex(argv[1]);
+ cout<<regex.disassemble();
+ string line;
+ while(getline(cin, line))
+ {
+ if(RegMatch match=regex.match(line))
+ {
+ cout<<line<<'\n';
+ }
+ }
+
+ return 0;
+}