src-highlite.git - src-highlite

index : src-highlite.git
src-highlite
summary refs log tree commit diff
path: root/src/check-regexp.cpp
diff options
context:
space:
mode:
authorLorenzo Bettini <bettini@dsi.unifi.it>2009年05月10日 13:24:00 +0000
committerLorenzo Bettini <bettini@dsi.unifi.it>2009年05月10日 13:24:00 +0000
commit8b3cfd4f8cec95f8772b332ca7063c0e4320aabd (patch)
treec11f54ee2b7840f560b47edf7fad61e5e7d9509a /src/check-regexp.cpp
parent33f908c175d133853b3328fb9267d5f0718ff1ff (diff)
downloadsrc-highlite-8b3cfd4f8cec95f8772b332ca7063c0e4320aabd.tar.gz
Version 3.0: shared library
Diffstat (limited to 'src/check-regexp.cpp')
-rw-r--r--src/check-regexp.cpp 11
1 files changed, 7 insertions, 4 deletions
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)) {
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 04:47:21 +0000

AltStyle によって変換されたページ (->オリジナル) /