boost-regex

unicode regular expressions c++

帅比萌擦擦* 提交于 2020-06-28 09:36:41
问题 I want to match the word "février" or any other month by using regular expression. Regular expression: ^(JANVIER|FEVRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AOUT|SEPTEMBRE|OCTOBRE|NOVEMBRE|DECEMBRE|Jan|Feb|Mar|Apr|May|Jun|JUN|Jul|Aug|Sep|Oct|Nov|Dec|[jJ]anvier|[Ff]évrier|[mM]ars|[aA]vril|[mM]ai|[jJ]uin|[jJ]uillet|[aA]o[éû]t|aout|[sS]eptembre|[oO]ctobre|[nN]ovembre|[dD][eé]cembre)$ Problem The problem is that I cannot match the words that contain unicode letters: à,é,è etc. I found on the following

unicode regular expressions c++

梦想与她 提交于 2020-06-28 09:31:19
问题 I want to match the word "février" or any other month by using regular expression. Regular expression: ^(JANVIER|FEVRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AOUT|SEPTEMBRE|OCTOBRE|NOVEMBRE|DECEMBRE|Jan|Feb|Mar|Apr|May|Jun|JUN|Jul|Aug|Sep|Oct|Nov|Dec|[jJ]anvier|[Ff]évrier|[mM]ars|[aA]vril|[mM]ai|[jJ]uin|[jJ]uillet|[aA]o[éû]t|aout|[sS]eptembre|[oO]ctobre|[nN]ovembre|[dD][eé]cembre)$ Problem The problem is that I cannot match the words that contain unicode letters: à,é,è etc. I found on the following

unicode regular expressions c++

回眸只為那壹抹淺笑 提交于 2020-06-28 09:31:06
问题 I want to match the word "février" or any other month by using regular expression. Regular expression: ^(JANVIER|FEVRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AOUT|SEPTEMBRE|OCTOBRE|NOVEMBRE|DECEMBRE|Jan|Feb|Mar|Apr|May|Jun|JUN|Jul|Aug|Sep|Oct|Nov|Dec|[jJ]anvier|[Ff]évrier|[mM]ars|[aA]vril|[mM]ai|[jJ]uin|[jJ]uillet|[aA]o[éû]t|aout|[sS]eptembre|[oO]ctobre|[nN]ovembre|[dD][eé]cembre)$ Problem The problem is that I cannot match the words that contain unicode letters: à,é,è etc. I found on the following

Is this c++ template param deduction incorrect?

久未见 提交于 2019-12-25 07:59:52
问题 #include <iostream> #include <regex> int main(void) { std::cmatch cm; std::regex_match("subject", cm, std::regex("(sub)(.*)")); //std::for_each(cm.begin(), cm.end(), [](const std::sub_match<const char *> &s){ <---- Working statement std::for_each(cm.begin(), cm.end(), [](const std::cmatch &s){ /*<--- Non-working statement*/ std::cout << "match:" << s.str() <<std::endl; }); return 0; } The error is as following: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr

Boost::Regex DOTALL flag

本秂侑毒 提交于 2019-12-25 04:55:19
问题 Is there a DOTALL matching flag for boost::regex? The documentation shows: static const match_flag_type match_not_dot_newline; static const match_flag_type match_not_dot_null; but no mention of regular DOTALL. I'm trying to match a python regular expression written as re.compile(r'<a(.*?)</a>', re.DOTALL) 回答1: I think what you're looking for is the mod_s syntax_option_type. You can also use the inline modifier, (?s) . 来源: https://stackoverflow.com/questions/1712696/boostregex-dotall-flag

Using custom allocator for boost::wregex

 ̄綄美尐妖づ 提交于 2019-12-24 19:09:16
问题 I created a custom allocator and want to use it all across our code. The way we did it is by defining the templates that wrap each containers we use and make use of our own allocator instead of the default: template <class Type> class myVector : public std::vector<Type, CCustomAllocator<Type>> and so we can use it in our code like this: myVector<int> x . This reduces the chance of making mistakes. we have similar wrappers for all the containers we use in our code: list , string , wstring , ..

When trying to include '#include <boost/regex.hpp>' I get: 1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_39.lib'

风格不统一 提交于 2019-12-23 10:58:25
问题 Not sure why i get that, I downloaded libs from here and while I have a lib called 'libboost_regex-vc90-mt-gd-1_39.lib I don't have one which is called 'libboost_regex-vc100-mt-gd-1_39.lib', renaming the one with vc90 to vc100 works but I'm not sure if this is the ideal solution? #include "stdafx.h" #include <regex> #include <boost/array.hpp> #include <boost/regex.hpp> #define BOOST_ALL_NO_LIB int _tmain(int argc, _TCHAR* argv[]) { boost::array<int, 10> a; boost::smatch s; getchar(); return 0

Ignore case using boost::regex_search

戏子无情 提交于 2019-12-23 07:38:41
问题 How do you use boost::regex_search with the ignore case flags or constants in C++? Please post an easy example. Thanks! 回答1: You need something like this boost::regex regex("your expression here", boost::regex::icase); boost::smatch what; string mystring; bool search_result = boost::regex_search(mystring.begin(),mystring.end(), what, regex); 回答2: Or something like this (without setting boost::regex::icase ): boost::regex regex("(?i)expression"); boost::smatch what; string mystring; bool

Boost.Regex vs C++11 Regex

喜你入骨 提交于 2019-12-21 07:08:16
问题 Could someone explain the differences between the two? Which would be better to learn right now? How would knowledge transfer from one to the other and vice-versa? 回答1: The boost regex library made it into C++0x so I'm guessing it will slowly be removed from boost. However, using boost is nice because you can still use it with compilers without C++0x support. So it's really up to you. 回答2: One major difference is, that C++11 does not provide the Perl syntax for regular expressions. So, if you

Boost.Regex vs C++11 Regex

左心房为你撑大大i 提交于 2019-12-21 07:08:01
问题 Could someone explain the differences between the two? Which would be better to learn right now? How would knowledge transfer from one to the other and vice-versa? 回答1: The boost regex library made it into C++0x so I'm guessing it will slowly be removed from boost. However, using boost is nice because you can still use it with compilers without C++0x support. So it's really up to you. 回答2: One major difference is, that C++11 does not provide the Perl syntax for regular expressions. So, if you