Recently, I used a regular expression to make a little thing, because I used C ++ to catch up with the trend. I used boost: xpressvie to get started, everything works normally on an HP Server, and then compiled on the sun server. I found that the compilation was not successful, and I fainted. Fortunately, I submitted a report to the boost website in time, otherwise, it will be a waste of time. Currently, I switched to the boost: RegEx module, but encountered a problem and found the following regular expression (0 | 1) + ,?) + For the short term of 00101010, there is no problem. When the string of 001010 is very long, an error is thrown directly, and the buddy does not know what is going on. Boost: xpressive
You do not know when the resolution can be completed.
Experiments at home are fast:
# Include "Boost/xpressive/xpressive_dynamic.hpp"
Using namespace boost: xpressive;
Void test_bitmap (){
Sregex Reg = sregex: Compile ("(1 | 0) + ,?) + ");
STD: String datas [] = {
"Aaa-1 & bbb-0 & ccc-1 ",
"1111000111 ",
"11001010,101100100101010010101 ",
"10010100101100110010101010101001010,101010 ",
"100101001010110011001010101010100101010101010 "};
For (INT I = 0; I <sizeof (datas)/sizeof (STD: string); ++ I ){
STD: cout <"match result:" <regex_match (datas [I], Reg) <", data:" <datas [I] <STD :: endl;
}
}
Int main (){
Cregex Reg = cregex: Compile ("(\ s * \ D + \ s * | (\ [| \\() \ s * \ D + \ s *, \ s * \ D + \ s * (\] | \\))) (\ s *, \ s * (\ s * \ D + \ s * | (\ [| \\() \ s * \ D + \ s *, \ s * \ D + \ s * (\] | \\))))*");
STD: cout <regex_match ("[10,100), 1, 8", Reg );
Test_bitmap ();
Return 0;
}