author | Lorenzo Bettini <bettini@dsi.unifi.it> | 2009年05月10日 13:24:00 +0000 |
---|---|---|
committer | Lorenzo Bettini <bettini@dsi.unifi.it> | 2009年05月10日 13:24:00 +0000 |
commit | 8b3cfd4f8cec95f8772b332ca7063c0e4320aabd (patch) | |
tree | c11f54ee2b7840f560b47edf7fad61e5e7d9509a /src/check-regexp.cpp | |
parent | 33f908c175d133853b3328fb9267d5f0718ff1ff (diff) | |
download | src-highlite-8b3cfd4f8cec95f8772b332ca7063c0e4320aabd.tar.gz |
-rw-r--r-- | src/check-regexp.cpp | 11 |
diff --git a/src/check-regexp.cpp b/src/check-regexp.cpp index 26eacbc..bae949c 100644 --- a/src/check-regexp.cpp +++ b/src/check-regexp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Lorenzo Bettini <http://www.lorenzobettini.it> + * Copyright (C) 2007-2009 Lorenzo Bettini <http://www.lorenzobettini.it> * * 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 @@ -24,7 +24,7 @@ /* * some examples: - * + * ./check-regexp "([^[:alnum:]]+)[^[:blank:]]*(1円)[^[:blank:]]*(1円)" "|w|\$|e|d| ^w^w^ ?a?b?" trying to match: |w|$|e|d| ^w^w^ ?a?b? @@ -45,18 +45,21 @@ what[3]: ? total number of matches: 3 - * + * */ #include <cstdlib> #include <boost/regex.hpp> #include <iostream> +#include "progname.h" + #include "check-regexp_cmd.h" using namespace std; int main(int argc, char * argv[]) { + set_program_name(argv[0]); gengetopt_args_info args_info; // command line structure if (cmdline_parser(argc, argv, &args_info)!= 0) @@ -85,7 +88,7 @@ int main(int argc, char * argv[]) { cout << "for the regexp : " << regex << endl; cout << "num of subexps : " << regex.mark_count() << endl; - + int num_of_matches = 0; while (boost::regex_search(start, end, what, regex, flags)) { |