summaryrefslogtreecommitdiff
path: root/examples/regex/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/regex/main.cc')
-rw-r--r--examples/regex/main.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/examples/regex/main.cc b/examples/regex/main.cc
index ed6ac567..e634fe5e 100644
--- a/examples/regex/main.cc
+++ b/examples/regex/main.cc
@@ -16,30 +16,25 @@
*/
#include <glibmm.h>
-#include <iostream>
#include <iomanip>
+#include <iostream>
-int main(int, char**)
+int
+main(int, char**)
{
Glib::init();
/* Reusing one regex pattern: */
const auto regex = Glib::Regex::create("(a)?(b)");
- std::cout << "Pattern=" << regex->get_pattern()
- << ", with string=abcd, result="
- << std::boolalpha << regex->match("abcd")
- << std::endl;
- std::cout << "Pattern=" << regex->get_pattern()
- << ", with string=1234, result="
- << std::boolalpha << regex->match("1234")
- << std::endl;
+ std::cout << "Pattern=" << regex->get_pattern() << ", with string=abcd, result=" << std::boolalpha
+ << regex->match("abcd") << std::endl;
+ std::cout << "Pattern=" << regex->get_pattern() << ", with string=1234, result=" << std::boolalpha
+ << regex->match("1234") << std::endl;
std::cout << std::endl;
/* Using the static function without a regex instance: */
- std::cout << "Pattern=b* with string=abcd, result="
- << std::boolalpha << Glib::Regex::match_simple("b*", "abcd")
- << std::endl;
+ std::cout << "Pattern=b* with string=abcd, result=" << std::boolalpha
+ << Glib::Regex::match_simple("b*", "abcd") << std::endl;
return 0;
}
-