{"id":314587,"date":"2020-12-09T15:01:12","date_gmt":"2020-12-09T15:01:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=314587"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=314587","title":{"rendered":"\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p><strong>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. \u0411\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u043a\u0443\u0440\u0441\u0430 <\/strong><a href=\"https:\/\/otus.pw\/dB0A\/\"><strong>&#171;C++ Developer. Professional&#187;<\/strong><\/a><strong> \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435 <\/strong><a href=\"https:\/\/otus.pw\/24ny\/\"><strong>&#171;Backend \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++&#187;<\/strong><\/a><\/p>\n<p><strong><br \/>\u0410 \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/strong><\/p>\n<\/blockquote>\n<hr>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/acd\/b12\/7b7\/acdb127b70f6d88ae3ecb8ebd32c4565\" width=\"1000\" height=\"420\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (Regular expressions \u0438\u043b\u0438, \u0432\u043a\u0440\u0430\u0442\u0446\u0435, regex \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438) \u2014 \u044d\u0442\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0438 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0435\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++. \u041d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0441 \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u043d\u043e \u0432\u044b \u043d\u0435 \u0443\u043c\u0435\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0432\u044b \u0440\u0430\u0437\u0431\u0430\u0437\u0430\u0440\u0438\u0432\u0430\u0435\u0442\u0435 20-30% \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u042f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u044f \u0432 \u0441\u0435\u0431\u044f (\u043f\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u201c<em>learn once, write anywhere\u201d<\/em>).<\/p>\n<blockquote>\n<p>\/!\\: \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0432 \u043c\u043e\u0435\u043c \u043b\u0438\u0447\u043d\u043e\u043c <a href=\"http:\/\/www.vishalchovatiya.com\/regex-c\/\">\u0431\u043b\u043e\u0433\u0435<\/a>. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0438 \u0441\u0430\u043c\u044b\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"http:\/\/eepurl.com\/gDNybv\">\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u043e\u044e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443<\/a>.<\/p>\n<\/blockquote>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0438 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u043c\u0435\u043d\u044f \u0432\u0432\u043e\u0434\u044f\u0442 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u0443\u044e <a href=\"http:\/\/www.vishalchovatiya.com\/regex-c\/#Motivation\">\u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438<\/a> \u0438 <a href=\"http:\/\/www.vishalchovatiya.com\/regex-c\/#Learning_Regex\">\u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a<\/a>. \u0412 \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0443\u0441\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e C++. \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 C++ \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0435\u0439 (&#171;flavours&#187;) \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043d\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u0437\u0434\u0435\u0441\u044c) \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 <a href=\"https:\/\/www.wikiwand.com\/en\/ECMAScript\">ECMAScript<\/a>.<\/p>\n<h3>\u041c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h3>\n<p>\u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a \u0441\u043a\u0443\u0434\u0435\u043d \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0432 24-\u0447\u0430\u0441\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u0442.\u0435. \u0427\u0427:\u041c\u041c), \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<pre><code>\\b([01]?[0-9]|2[0-3]):([0-5]\\d)\\b<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0434\u0430! \u041a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c?<\/p>\n<p>\u0418 \u0432\u0441\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u043c \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u043e, \u043d\u0430 100% \u043d\u0435\u0431\u0435\u0437\u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u042f \u0441\u0430\u043c \u0434\u0432\u0430\u0436\u0434\u044b \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435. \u041d\u043e, \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u044d\u0442\u043e\u0442 \u043d\u0435\u043f\u0440\u0438\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u043b\u043e\u0445.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 (\u2193), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e, \u043d\u0435 \u043e\u0442\u043d\u0438\u043c\u0435\u0442 \u0443 \u0432\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 2-3 \u0447\u0430\u0441\u043e\u0432 \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043f\u043e \u043f\u0440\u0430\u0432\u0434\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u0438\u0445 \u043e\u0441\u0432\u043e\u0438\u0442\u0435, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0430\u0448\u0430 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u044f \u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0434\u0438\u0432\u0438\u0434\u0435\u043d\u0434\u044b.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h3>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0433\u0443\u0433\u043b\u0438\u0442\u044c \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0443\u0447\u0435\u0431\u043d\u0438\u043a \u043b\u0443\u0447\u0448\u0435. \u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0442\u0440\u0430\u0442\u044c\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 (\u043d\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f) \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u0433\u0430\u0434\u0430\u0442\u044c, \u0433\u0434\u0435 \u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0430\u0442\u044c, \u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044f\u0441\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <a href=\"https:\/\/regexone.com\/\">https:\/\/regexone.com<\/a>. \u0418 \u043f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0432\u0441\u0435 \u0443\u0440\u043e\u043a\u0438. \u041f\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043c\u043d\u0435, \u044f \u043f\u0435\u0440\u0435\u043b\u043e\u043f\u0430\u0442\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439, <a href=\"https:\/\/www.udemy.com\/course\/regex-academy-an-introduction-to-text-parsing-sorcery\/\">\u043a\u0443\u0440\u0441\u043e\u0432<\/a> (&lt;= \u044d\u0442\u043e\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439, \u043a\u0441\u0442\u0430\u0442\u0438) \u0438 \u043a\u043d\u0438\u0433. \u041d\u043e \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><a href=\"http:\/\/regextutorials.com\/\">\u0423\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u043d\u0430 regextutorials.com<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.hackerrank.com\/domains\/regex\">\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 hackerrank<\/a><\/p>\n<\/li>\n<\/ol>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex \u0438 std::regexerror<\/h3>\n<pre><code class=\"cpp\">int main() {     try {         static const auto r = std::regex(R\"(\\)\"); \/\/ Escape sequence error     } catch (const std::regex_error &amp;e) {         assert(strcmp(e.what(), \"Unexpected end of regex when escaping.\") == 0);         assert(e.code() == std::regex_constants::error_escape);     }     return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0432\u0438\u0434\u0438\u0442\u0435! \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/string_literal\">\u0441\u044b\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/a>. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u044d\u043a\u0441\u043b\u0435\u0448 (\\) \u0434\u043b\u044f escape-\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>std::regex<\/code> \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f (\u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f), \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 (\u043d\u0435 allocator aware). \u0411\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>std::regex<\/code> \u0432 \u0446\u0438\u043a\u043b\u0435 (\u0441\u043c. <a href=\"https:\/\/www.youtube.com\/watch?v=7hfSyxNxFfo\">C++ Weekly &#8212; Ep 74 &#8212; std::regex optimize by Jason Turner<\/a>). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043a\u0430\u043a \u044f \u0434\u0443\u043c\u0430\u044e, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u2014 \u044d\u0442\u043e <code>std::regex::markcount()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0443\u043f\u043f \u0437\u0430\u0445\u0432\u0430\u0442\u0430.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u043e \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"http:\/\/www.vishalchovatiya.com\/7-best-practices-for-exception-handling-in-cpp-with-example\/\">\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/a> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>std::regexerror)<\/code><em>, <\/em>\u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_search<\/h3>\n<pre><code class=\"cpp\">int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\w+);)\");     smatch m;      if (regex_search(input, m, r)) {         assert(m.size() == 3);         assert(m[0].str() == \"PQR:2;\");                \/\/ Entire match         assert(m[1].str() == \"PQR\");                   \/\/ Substring that matches 1st group         assert(m[2].str() == \"2\");                     \/\/ Substring that matches 2nd group         assert(m.prefix().str() == \"ABC:1-&gt;   \");      \/\/ All before 1st character match         assert(m.suffix().str() == \";;   XYZ:3&lt;&lt;&lt;\");   \/\/ All after last character match          \/\/ for (string &amp;&amp;str : m) { \/\/ Alternatively. You can also do         \/\/     cout &lt;&lt; str &lt;&lt; endl;         \/\/ }     }     return EXIT_SUCCESS; }<\/code><\/pre>\n<p><code>smatch<\/code> \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/regex\/match_results\">std::match_<em>results<\/em><\/a><em>, <\/em>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f\u0445 (\u043c\u0430\u0442\u0447\u0430\u0445).<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_match<\/h3>\n<p>\u041b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043d\u0438\u0433\u0435 \u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u0445, &#8212; \u044d\u0442\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>std::regexmatch<\/code><em>.<\/em><\/p>\n<pre><code class=\"cpp\">bool is_valid_email_id(string_view str) {     static const regex r(R\"(\\w+@\\w+\\.(?:com|in))\");     return regex_match(str.data(), r); }  int main() {     assert(is_valid_email_id(\"vishalchovatiya@ymail.com\") == true);     assert(is_valid_email_id(\"@abc.com\") == false);     return EXIT_SUCCESS; }<\/code><\/pre>\n<p><code>return EXIT\u00a8C14Cmatch<\/code>, \u0430 \u043d\u0435 <code>std::regex\u00a8C15Cmatch<\/code> \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 (\u043c\u0430\u0442\u0447\u0438\u0442) \u0432\u0441\u044e \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0449\u044c \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (static const regex), \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f (\u00ab\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438\/\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438\u00bb) \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0412\u0441\u044f \u0438\u0440\u043e\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 30 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c -O3. \u0418 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043c\u0435\u0448\u043d\u043e. \u041d\u043e \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u044d\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0432\u0435\u0434\u0435\u043d\u043e \u0434\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430 ISO C++. \u0418 \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0449\u0435\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b (\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438).<\/p>\n<h3>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 std::regex_match \u0438 std::regex_search<\/h3>\n<p>\u0412\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443? \u0414\u0430\u0436\u0435 \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u044d\u0442\u043e\u0433\u043e. \u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e cppreference, \u044f \u043d\u0430\u0448\u0435\u043b \u043e\u0442\u0432\u0435\u0442. \u0418 \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 (\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043d\u0435 \u0431\u0435\u0437 \u043f\u043e\u043c\u043e\u0449\u0438 StackOverflow):<\/p>\n<pre><code>int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\w+);)\");     smatch m;      assert(regex_match(input, m, r) == false);      assert(regex_search(input, m, r) == true &amp;&amp; m.ready() == true &amp;&amp; m[1] == \"PQR\");      return EXIT_SUCCESS; }<\/code><\/pre>\n<p><code>std::regexmatch<\/code><em> <\/em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u200b\u200b\u0432\u0441\u044f \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <code>std::regexsearch<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>true<\/code>, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_iterator<\/h3>\n<p><code>std::regex_iterator<\/code> \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f\u0445 \u0438 \u0441\u0430\u0431\u043c\u0430\u0442\u0447\u0430\u0445.<\/p>\n<pre><code class=\"cpp\">#define C_ALL(X) cbegin(X), cend(X)  int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\d))\");      const vector&lt;smatch&gt; matches{         sregex_iterator{C_ALL(input), r},         sregex_iterator{}     };      assert(matches[0].str(0) == \"ABC:1\"          &amp;&amp; matches[0].str(1) == \"ABC\"          &amp;&amp; matches[0].str(2) == \"1\");      assert(matches[1].str(0) == \"PQR:2\"          &amp;&amp; matches[1].str(1) == \"PQR\"          &amp;&amp; matches[1].str(2) == \"2\");      assert(matches[2].str(0) == \"XYZ:3\"          &amp;&amp; matches[2].str(1) == \"XYZ\"          &amp;&amp; matches[2].str(2) == \"3\");      return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0420\u0430\u043d\u0435\u0435 (\u0432 C++11) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>std::regex_interator<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 C++14.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_token_iterator<\/h3>\n<p><code>std::regextokeniterator<\/code> \u2014 \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 80% \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u041e\u043d\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 <code>std::regexiterator<\/code>. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 <code>td::regexiterator<\/code> \u0438 <code>std::regextokeniterator<\/code> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e<\/p>\n<ul>\n<li>\n<p><code>std::regexiterator<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p><code>std::regextokeniterator<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0430\u0431\u043c\u0430\u0442\u0447\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 <code>std::regextoken_iterator<\/code> \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<pre><code class=\"cpp\">#define C_ALL(X) cbegin(X), cend(X)  int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\d))\");      \/\/ Note: vector&lt;string&gt; here, unlike vector&lt;smatch&gt; as in std::regex_iterator     const vector&lt;string&gt; full_match{         sregex_token_iterator{C_ALL(input), r, 0}, \/\/ Mark `0` here i.e. whole regex match         sregex_token_iterator{}     };     assert((full_match == decltype(full_match){\"ABC:1\", \"PQR:2\", \"XYZ:3\"}));      const vector&lt;string&gt; cptr_grp_1st{         sregex_token_iterator{C_ALL(input), r, 1}, \/\/ Mark `1` here i.e. 1st capture group         sregex_token_iterator{}     };     assert((cptr_grp_1st == decltype(cptr_grp_1st){\"ABC\", \"PQR\", \"XYZ\"}));      const vector&lt;string&gt; cptr_grp_2nd{         sregex_token_iterator{C_ALL(input), r, 2}, \/\/ Mark `2` here i.e. 2nd capture group         sregex_token_iterator{}     };     assert((cptr_grp_2nd == decltype(cptr_grp_2nd){\"1\", \"2\", \"3\"}));      return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0441 std::regex_token_iterator<\/h3>\n<pre><code class=\"cpp\">#define C_ALL(X) cbegin(X), cend(X)  int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\d))\");      const vector&lt;string&gt; inverted{         sregex_token_iterator{C_ALL(input), r, -1}, \/\/ `-1` = parts that are not matched         sregex_token_iterator{}     };     assert((inverted == decltype(inverted){                             \"\",                             \"-&gt;   \",                             \";;;   \",                             \"&lt;&lt;&lt;\",                         }));      return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_replace<\/h3>\n<pre><code class=\"cpp\">string transform_pair(string_view text, regex_constants::match_flag_type f = {}) {     static const auto r = regex(R\"((\\w+):(\\d))\");     return regex_replace(text.data(), r, \"$2\", f); }  int main() {     assert(transform_pair(\"ABC:1, PQR:2\"s) == \"1, 2\"s);      \/\/ Things that aren't matched are not copied     assert(transform_pair(\"ABC:1, PQR:2\"s, regex_constants::format_no_copy) == \"12\"s);     return EXIT_SUCCESS; }<\/code><\/pre>\n<\/p>\n<p>\u0412\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>transformpair<\/code> \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0444\u043b\u0430\u0433 <code>std::regexconstants::formatnocopy<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u0447\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0435. \u0412 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/regex\/match_flag_type\">std::regexconstant<\/a> \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u043b\u0430\u0433\u043e\u0432.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043f\u043e\u0442\u043e\u043a \u0438\u043b\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u0423\u0433\u0430\u0434\u0430\u0439\u0442\u0435, \u0447\u0442\u043e! \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e <code>std::regexreplace<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"(-|&gt;|&lt;|;| )\");      \/\/ Prints \"ABC:1     PQR:2      XYZ:3   \"     regex_replace(ostreambuf_iterator&lt;char&gt;(cout), C_ALL(input), r, \" \");      return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<h4>\u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f (delimiter)<\/h4>\n<p><code>std::strtok<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u043c \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">#define C_ALL(X) cbegin(X), cend(X)  vector&lt;string&gt; split(const string&amp; str, string_view pattern) {     const auto r = regex(pattern.data());     return vector&lt;string&gt;{         sregex_token_iterator(C_ALL(str), r, -1),         sregex_token_iterator()     }; }  int main() {     assert((split(\"\/root\/home\/vishal\", \"\/\")                 == vector&lt;string&gt;{\"\", \"root\", \"home\", \"vishal\"}));     return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/h3>\n<pre><code class=\"cpp\">string trim(string_view text) {     static const auto r = regex(R\"(\\s+)\");     return regex_replace(text.data(), r, \"\"); }  int main() {     assert(trim(\"12   3 4      5\"s) == \"12345\"s);     return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u041f\u043e\u0438\u0441\u043a \u0441\u0442\u0440\u043e\u043a, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0438\u043b\u0438 \u041d\u0415 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<\/h3>\n<pre><code class=\"cpp\">string join(const vector&lt;string&gt;&amp; words, const string&amp; delimiter) {     return accumulate(next(begin(words)), end(words), words[0],             [&amp;delimiter](string&amp; p, const string&amp; word)             {                 return p + delimiter + word;             }); }  vector&lt;string&gt; lines_containing(const string&amp; file, const vector&lt;string&gt;&amp; words) {     auto prefix = \"^.*?\\\\b(\"s;     auto suffix = \")\\\\b.*$\"s;      \/\/  ^.*?\\b(one|two|three)\\b.*$     const auto pattern = move(prefix) + join(words, \"|\") + move(suffix);      ifstream        infile(file);     vector&lt;string&gt;  result;      for (string line; getline(infile, line);) {         if(regex_match(line, regex(pattern))) {             result.emplace_back(move(line));         }     }      return result; }  int main() {    assert((lines_containing(\"test.txt\", {\"one\",\"two\"})                                         == vector&lt;string&gt;{\"This is one\",                                                           \"This is two\"}));     return EXIT_SUCCESS; } \/* test.txt This is one This is two This is three This is four *\/<\/code><\/pre>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u043e\u0432 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c <code>^((?!(one|two|three)).)*$<\/code>.<\/p>\n<h3>\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435<\/h3>\n<pre><code class=\"cpp\">namespace fs = std::filesystem;  vector&lt;fs::directory_entry&gt; find_files(const fs::path &amp;path, string_view rg) {     vector&lt;fs::directory_entry&gt; result;     regex r(rg.data());     copy_if(         fs::recursive_directory_iterator(path),         fs::recursive_directory_iterator(),         back_inserter(result),         [&amp;r](const fs::directory_entry &amp;entry) {             return fs::is_regular_file(entry.path()) &amp;&amp;                    regex_match(entry.path().filename().string(), r);         });     return result; }  int main() {     const auto dir        = fs::temp_directory_path();     const auto pattern    = R\"(\\w+\\.png)\";     const auto result     = find_files(fs::current_path(), pattern);     for (const auto &amp;entry : result) {         cout &lt;&lt; entry.path().string() &lt;&lt; endl;     }     return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u041e\u0431\u0449\u0438\u0435 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h3>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 C++ \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u044b\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/regex101.com\/\">https:\/\/regex101.com<\/a>. \u0427\u0442\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/regex101.com\/\">regex101<\/a>, \u0442\u0430\u043a \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043f\u0440\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f).<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0442\u043e\u043d\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043d\u0430\u0434 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p><strong>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0447\u0435\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 (alternation), \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043d\u0430\u0438\u0432\u044b\u0441\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>com|net|org<\/code>.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0421\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0435\u043d\u0438\u0432\u044b\u0435 \u043a\u0432\u0430\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437 \u0437\u0430\u0445\u0432\u0430\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 \u0431\u044d\u043a\u0442\u0440\u0435\u043a\u0438\u043d\u0433.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u0435\u043b\u043e \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0431\u0443\u0434\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 C++ \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c. \u042f \u0441\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u0445 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 IDE (\u0432 vscode \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043b\u043e\u0433\u043e\u0432) \u0438 \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 Linux. \u0418\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u0430\u0435\u0442 \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0435 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0418 \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u0441\u0435\u0440\u0434\u0438\u0442\u044c \u043d\u0430 \u0432\u0430\u0441 \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u0433 (\u0438 \u0432\u0441\u0435\u0445, \u043a\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0437\u0430\u0434\u0430\u0447 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<p>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0433\u0434\u0435 \u0440\u0443\u043a\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u043e\u043b\u044c \u0436\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c; \u0438 \u0434\u043b\u044f \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0433\u0434\u0430 \u0443\u0434\u043e\u0431\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u0435\u0448\u0438\u0432\u0430\u044e\u0442 \u0438\u0445 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0449\u044c \u2014 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 (\u0434\u043e 19 \u0438\u044e\u043d\u044f 2020 \u0433\u043e\u0434\u0430) \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0440\u0430\u0437\u0434\u0443\u0442\u0438\u0435\u043c \u043a\u043e\u0434\u0430. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u0441 \u0443\u043c\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Boost, CTRE \u0438 Std. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0425\u0430\u043d\u044b \u0414\u0443\u0441\u0438\u043a\u043e\u0432\u043e\u0439 \u043d\u0430\u0434 <a href=\"https:\/\/github.com\/hanickadot\/compile-time-regular-expressions\">\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0435 \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 CppCon \u0432 <a href=\"https:\/\/www.youtube.com\/watch?v=QM3W36COnE4&amp;list=WL&amp;index=9&amp;t=0s\">2018<\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=8dKWdJzPwHw\">2019<\/a> \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<hr>\n<blockquote>\n<p><a href=\"https:\/\/otus.pw\/dB0A\/\"><strong>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435<\/strong><\/a><strong> &#171;C++ Developer. Professional&#187;<\/strong><\/p>\n<\/p>\n<p><a href=\"https:\/\/otus.pw\/24ny\/\"><strong>\u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435<\/strong><\/a><strong> &#171;Backend \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++&#187;<\/strong><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9e\/baf\/fa7\/b9ebaffa788bb57a3df2988c3c014c69.jpg\" width=\"780\" height=\"300\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/otus.pw\/EipQ\/\"><strong>\u0417\u0410\u0411\u0420\u0410\u0422\u042c \u0421\u041a\u0418\u0414\u041a\u0423<\/strong><\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/532056\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/532056\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p><strong>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. \u0411\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u043a\u0443\u0440\u0441\u0430 <\/strong><a href=\"https:\/\/otus.pw\/dB0A\/\"><strong>&#171;C++ Developer. Professional&#187;<\/strong><\/a><strong> \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435 <\/strong><a href=\"https:\/\/otus.pw\/24ny\/\"><strong>&#171;Backend \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++&#187;<\/strong><\/a><\/p>\n<p><strong><br \/>\u0410 \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/strong><\/p>\n<\/blockquote>\n<hr>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (Regular expressions \u0438\u043b\u0438, \u0432\u043a\u0440\u0430\u0442\u0446\u0435, regex \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438) \u2014 \u044d\u0442\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0438 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0435\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c C++. \u041d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0441 \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u043d\u043e \u0432\u044b \u043d\u0435 \u0443\u043c\u0435\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0432\u044b \u0440\u0430\u0437\u0431\u0430\u0437\u0430\u0440\u0438\u0432\u0430\u0435\u0442\u0435 20-30% \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u042f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u044f \u0432 \u0441\u0435\u0431\u044f (\u043f\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u201c<em>learn once, write anywhere\u201d<\/em>).<\/p>\n<blockquote>\n<p>\/!\\: \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0432 \u043c\u043e\u0435\u043c \u043b\u0438\u0447\u043d\u043e\u043c <a href=\"http:\/\/www.vishalchovatiya.com\/regex-c\/\">\u0431\u043b\u043e\u0433\u0435<\/a>. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0438 \u0441\u0430\u043c\u044b\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"http:\/\/eepurl.com\/gDNybv\">\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u043e\u044e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443<\/a>.<\/p>\n<\/blockquote>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0438 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u043c\u0435\u043d\u044f \u0432\u0432\u043e\u0434\u044f\u0442 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u0443\u044e <a href=\"http:\/\/www.vishalchovatiya.com\/regex-c\/#Motivation\">\u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438<\/a> \u0438 <a href=\"http:\/\/www.vishalchovatiya.com\/regex-c\/#Learning_Regex\">\u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a<\/a>. \u0412 \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0443\u0441\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e C++. \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 C++ \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0435\u0439 (&#171;flavours&#187;) \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043d\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u0437\u0434\u0435\u0441\u044c) \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 <a href=\"https:\/\/www.wikiwand.com\/en\/ECMAScript\">ECMAScript<\/a>.<\/p>\n<h3>\u041c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h3>\n<p>\u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a \u0441\u043a\u0443\u0434\u0435\u043d \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0432 24-\u0447\u0430\u0441\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u0442.\u0435. \u0427\u0427:\u041c\u041c), \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<pre><code>\\b([01]?[0-9]|2[0-3]):([0-5]\\d)\\b<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0434\u0430! \u041a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c?<\/p>\n<p>\u0418 \u0432\u0441\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u043c \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u043e, \u043d\u0430 100% \u043d\u0435\u0431\u0435\u0437\u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u042f \u0441\u0430\u043c \u0434\u0432\u0430\u0436\u0434\u044b \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435. \u041d\u043e, \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u044d\u0442\u043e\u0442 \u043d\u0435\u043f\u0440\u0438\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u043b\u043e\u0445.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 (\u2193), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e, \u043d\u0435 \u043e\u0442\u043d\u0438\u043c\u0435\u0442 \u0443 \u0432\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 2-3 \u0447\u0430\u0441\u043e\u0432 \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043f\u043e \u043f\u0440\u0430\u0432\u0434\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u0438\u0445 \u043e\u0441\u0432\u043e\u0438\u0442\u0435, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0430\u0448\u0430 \u0438\u043d\u0432\u0435\u0441\u0442\u0438\u0446\u0438\u044f \u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0434\u0438\u0432\u0438\u0434\u0435\u043d\u0434\u044b.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h3>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0433\u0443\u0433\u043b\u0438\u0442\u044c \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0443\u0447\u0435\u0431\u043d\u0438\u043a \u043b\u0443\u0447\u0448\u0435. \u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0442\u0440\u0430\u0442\u044c\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 (\u043d\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f) \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u0433\u0430\u0434\u0430\u0442\u044c, \u0433\u0434\u0435 \u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0430\u0442\u044c, \u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044f\u0441\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <a href=\"https:\/\/regexone.com\/\">https:\/\/regexone.com<\/a>. \u0418 \u043f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0432\u0441\u0435 \u0443\u0440\u043e\u043a\u0438. \u041f\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043c\u043d\u0435, \u044f \u043f\u0435\u0440\u0435\u043b\u043e\u043f\u0430\u0442\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439, <a href=\"https:\/\/www.udemy.com\/course\/regex-academy-an-introduction-to-text-parsing-sorcery\/\">\u043a\u0443\u0440\u0441\u043e\u0432<\/a> (&lt;= \u044d\u0442\u043e\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439, \u043a\u0441\u0442\u0430\u0442\u0438) \u0438 \u043a\u043d\u0438\u0433. \u041d\u043e \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><a href=\"http:\/\/regextutorials.com\/\">\u0423\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u043d\u0430 regextutorials.com<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.hackerrank.com\/domains\/regex\">\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 hackerrank<\/a><\/p>\n<\/li>\n<\/ol>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex \u0438 std::regexerror<\/h3>\n<pre><code class=\"cpp\">int main() {     try {         static const auto r = std::regex(R\"(\\)\"); \/\/ Escape sequence error     } catch (const std::regex_error &amp;e) {         assert(strcmp(e.what(), \"Unexpected end of regex when escaping.\") == 0);         assert(e.code() == std::regex_constants::error_escape);     }     return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0432\u0438\u0434\u0438\u0442\u0435! \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/string_literal\">\u0441\u044b\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/a>. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0431\u044d\u043a\u0441\u043b\u0435\u0448 (\\) \u0434\u043b\u044f escape-\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>std::regex<\/code> \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f (\u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f), \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 (\u043d\u0435 allocator aware). \u0411\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>std::regex<\/code> \u0432 \u0446\u0438\u043a\u043b\u0435 (\u0441\u043c. <a href=\"https:\/\/www.youtube.com\/watch?v=7hfSyxNxFfo\">C++ Weekly &#8212; Ep 74 &#8212; std::regex optimize by Jason Turner<\/a>). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043a\u0430\u043a \u044f \u0434\u0443\u043c\u0430\u044e, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u2014 \u044d\u0442\u043e <code>std::regex::markcount()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0443\u043f\u043f \u0437\u0430\u0445\u0432\u0430\u0442\u0430.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u043e \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"http:\/\/www.vishalchovatiya.com\/7-best-practices-for-exception-handling-in-cpp-with-example\/\">\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/a> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>std::regexerror)<\/code><em>, <\/em>\u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_search<\/h3>\n<pre><code class=\"cpp\">int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\w+);)\");     smatch m;      if (regex_search(input, m, r)) {         assert(m.size() == 3);         assert(m[0].str() == \"PQR:2;\");                \/\/ Entire match         assert(m[1].str() == \"PQR\");                   \/\/ Substring that matches 1st group         assert(m[2].str() == \"2\");                     \/\/ Substring that matches 2nd group         assert(m.prefix().str() == \"ABC:1-&gt;   \");      \/\/ All before 1st character match         assert(m.suffix().str() == \";;   XYZ:3&lt;&lt;&lt;\");   \/\/ All after last character match          \/\/ for (string &amp;&amp;str : m) { \/\/ Alternatively. You can also do         \/\/     cout &lt;&lt; str &lt;&lt; endl;         \/\/ }     }     return EXIT_SUCCESS; }<\/code><\/pre>\n<p><code>smatch<\/code> \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/regex\/match_results\">std::match_<em>results<\/em><\/a><em>, <\/em>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f\u0445 (\u043c\u0430\u0442\u0447\u0430\u0445).<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_match<\/h3>\n<p>\u041b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043d\u0438\u0433\u0435 \u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u0445, &#8212; \u044d\u0442\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>std::regexmatch<\/code><em>.<\/em><\/p>\n<pre><code class=\"cpp\">bool is_valid_email_id(string_view str) {     static const regex r(R\"(\\w+@\\w+\\.(?:com|in))\");     return regex_match(str.data(), r); }  int main() {     assert(is_valid_email_id(\"vishalchovatiya@ymail.com\") == true);     assert(is_valid_email_id(\"@abc.com\") == false);     return EXIT_SUCCESS; }<\/code><\/pre>\n<p><code>return EXIT\u00a8C14Cmatch<\/code>, \u0430 \u043d\u0435 <code>std::regex\u00a8C15Cmatch<\/code> \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 (\u043c\u0430\u0442\u0447\u0438\u0442) \u0432\u0441\u044e \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0449\u044c \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (static const regex), \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f (\u00ab\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438\/\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438\u00bb) \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0412\u0441\u044f \u0438\u0440\u043e\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 30 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c -O3. \u0418 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043c\u0435\u0448\u043d\u043e. \u041d\u043e \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u044d\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0432\u0435\u0434\u0435\u043d\u043e \u0434\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430 ISO C++. \u0418 \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0449\u0435\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b (\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438).<\/p>\n<h3>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 std::regex_match \u0438 std::regex_search<\/h3>\n<p>\u0412\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443? \u0414\u0430\u0436\u0435 \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u044d\u0442\u043e\u0433\u043e. \u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e cppreference, \u044f \u043d\u0430\u0448\u0435\u043b \u043e\u0442\u0432\u0435\u0442. \u0418 \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 (\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043d\u0435 \u0431\u0435\u0437 \u043f\u043e\u043c\u043e\u0449\u0438 StackOverflow):<\/p>\n<pre><code>int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\w+);)\");     smatch m;      assert(regex_match(input, m, r) == false);      assert(regex_search(input, m, r) == true &amp;&amp; m.ready() == true &amp;&amp; m[1] == \"PQR\");      return EXIT_SUCCESS; }<\/code><\/pre>\n<p><code>std::regexmatch<\/code><em> <\/em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u200b\u200b\u0432\u0441\u044f \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <code>std::regexsearch<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>true<\/code>, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_iterator<\/h3>\n<p><code>std::regex_iterator<\/code> \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f\u0445 \u0438 \u0441\u0430\u0431\u043c\u0430\u0442\u0447\u0430\u0445.<\/p>\n<pre><code class=\"cpp\">#define C_ALL(X) cbegin(X), cend(X)  int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\d))\");      const vector&lt;smatch&gt; matches{         sregex_iterator{C_ALL(input), r},         sregex_iterator{}     };      assert(matches[0].str(0) == \"ABC:1\"          &amp;&amp; matches[0].str(1) == \"ABC\"          &amp;&amp; matches[0].str(2) == \"1\");      assert(matches[1].str(0) == \"PQR:2\"          &amp;&amp; matches[1].str(1) == \"PQR\"          &amp;&amp; matches[1].str(2) == \"2\");      assert(matches[2].str(0) == \"XYZ:3\"          &amp;&amp; matches[2].str(1) == \"XYZ\"          &amp;&amp; matches[2].str(2) == \"3\");      return EXIT_SUCCESS; }<\/code><\/pre>\n<p>\u0420\u0430\u043d\u0435\u0435 (\u0432 C++11) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>std::regex_interator<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 C++14.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 std::regex_token_iterator<\/h3>\n<p><code>std::regextokeniterator<\/code> \u2014 \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 80% \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u041e\u043d\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 <code>std::regexiterator<\/code>. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 <code>td::regexiterator<\/code> \u0438 <code>std::regextokeniterator<\/code> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e<\/p>\n<ul>\n<li>\n<p><code>std::regexiterator<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p><code>std::regextokeniterator<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0430\u0431\u043c\u0430\u0442\u0447\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 <code>std::regextoken_iterator<\/code> \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<pre><code class=\"cpp\">#define C_ALL(X) cbegin(X), cend(X)  int main() {     const string input = \"ABC:1-&gt;   PQR:2;;;   XYZ:3&lt;&lt;&lt;\"s;     const regex r(R\"((\\w+):(\\d))\");      \/\/ Note: vector&lt;string&gt; here, unlike vector&lt;smatch&gt; as in std::regex_iterator     const vector&lt;string&gt; full_match{         sregex_token_iterator{C_ALL(input), r, 0}, \/\/ Mark `0` here i.e. whole regex match         sregex_token_iterator{}     };     assert((full_match == decltype(full_match){\"ABC:1\", \"PQR:2\", \"XYZ:3\"}));      const vector&lt;string&gt; cptr_grp_1st{         sregex_token_iterator{C_ALL(input), r, 1}, \/\/ Mark `1` here i.e. 1st capture group         sregex_token_iterator{}     };     assert((cptr_grp_1st == decltype(cptr_grp_1st){\"ABC\", \"PQR\", \"XYZ\"}));      const vector&lt;string&gt; cptr_grp_2nd{         sregex_token_iterator{C_ALL(input), r, 2}, \/\/ Mark `2` here i.e. 2nd capture group         sregex_token_iterator{}     };     assert((cptr_grp_2nd == decltype(cptr_grp_2nd){\"1\", \"2\", \"3\"}));      return EXIT_SUCCESS; }<\/code><\/pre>\n<h3>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f<\/h><\/hr>\n<\/blockquote>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-314587","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/314587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=314587"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/314587\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=314587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=314587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=314587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}