C++ Regex Library - regex_match - Tutorialspoint

文章推薦指數: 80 %
投票人數:10人

C++ Regex Library - regex_match, It returns whether the target sequence matches the regular expression rgx. The target sequence is either s or the character ... Home CodingGround Jobs Whiteboard Tools Business Teachwithus TheCStandardLibrary TheCStandardLibrary TheC++StandardLibrary C++Library-Home C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- TheC++STLLibrary C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++Library- C++ProgrammingResources C++ProgrammingTutorial C++UsefulResources C++Discussion SelectedReading UPSCIASExamsNotes Developer'sBestPractices QuestionsandAnswers EffectiveResumeWriting HRInterviewQuestions ComputerGlossary WhoisWho C++RegexLibrary-regex_match Advertisements PreviousPage NextPage  Description Itreturnswhetherthetargetsequencematchestheregularexpressionrgx.Thetargetsequenceiseithersorthecharactersequencebetweenfirstandlast,dependingontheversionused. Declaration Followingisthedeclarationforstd::regex_match. template boolregex_match(constcharT*s,constbasic_regex&rgx, regex_constants::match_flag_typeflags=regex_constants::match_default); C++11 template boolregex_match(constcharT*s,constbasic_regex&rgx, regex_constants::match_flag_typeflags=regex_constants::match_default); C++14 template boolregex_match(constcharT*s,constbasic_regex&rgx, regex_constants::match_flag_typeflags=regex_constants::match_default); Parameters s−Itisastringwiththetargetsequence. rgx−Itisabasic_regexobjecttomatch. flags−Itisusedtocontrolhowrgxismatched. m−Itisanobjectofamatch_resultstype. ReturnValue Itreturnstrueifrgxismatchedagainstthetargetsequence.falseotherwise. Exceptions No-noexcept−thismemberfunctionneverthrowsexceptions. Example Inbelowexampleforstd::regex_match. LiveDemo #include #include #include intmain(){ if(std::regex_match("subject",std::regex("(sub)(.*)"))) std::cout<



請為這篇文章評分?