Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正規表現パターンが次の形式である場合、文字列内の何かを照合するときにregex_searchはregex_matchと同等になりますか?つまり、一致するものが^.......$文字列の先頭にあり、文字列の末尾で終了する必要があると言った場合 それとも他に違いはありますか?
^.......$
いいえ、これらは同等ではありません。regex_searchの$は行末に一致し、^は行開始に一致するためです。したがって、複数行の文字列でも、regex_searchは部分一致を検索します。フラグboost::match_not_eolとboost::match_not_bolを追加すると、regex_matchの動作が作成されると思います。