{"id":321437,"date":"2021-04-14T15:00:45","date_gmt":"2021-04-14T15:00:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321437"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321437","title":{"rendered":"\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f Python \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432: \u0447\u0442\u043e \u044d\u0442\u043e, \u0437\u0430\u0447\u0435\u043c \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d49\/8d3\/817\/d498d381796001c1acbb991bb52bc199.webp\" alt=\"image\"><\/p>\n<p>  \u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, data science \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u044d\u0442\u0438\u043c\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442\u0440\u0430\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0448\u0430\u0433\u043d\u0443\u043b\u0438 \u0432\u043f\u0435\u0440\u0435\u0434. \u0412\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Python \u0438 JavaScript \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c-\u0442\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043d\u0443\u0436\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u0435\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 Twitter \u0438\u043b\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0441\u0432\u043e\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043b <a href=\"https:\/\/habr.com\/ru\/users\/znbiz\/\">\u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u041d\u0435\u043a\u0440\u0430\u0441\u043e\u0432<\/a> \u2014 \u043b\u0438\u0434\u0435\u0440 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Python \u0432 \u041c\u0422\u0421, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Python \u0432 Skillbox. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0433\u0434\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0430 \u0433\u0434\u0435 \u2014 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0446\u0438\u0442\u0430\u0442\u043e\u0439. <br \/>  <a name=\"habracut\"><\/a>   <\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f?<\/h3>\n<p>  \u041e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:  <\/p>\n<ul>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0438\u043b\u0438 e-mail \u0430\u0434\u0440\u0435\u0441.<\/li>\n<li>\u0420\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438.<\/li>\n<li>\u0418\u0441\u043a\u0430\u0442\u044c, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b.<\/li>\n<li>\u0411\u044b\u0441\u0442\u0440\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043d\u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0438 \u0432\u0435\u0437\u0434\u0435. \u041f\u0440\u0438\u0447\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Python, \u043d\u043e \u0438 \u043b\u044e\u0431\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0443\u0436\u043d\u044b? \u041a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432 Python \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0430 \u0442\u0430\u043a\u0438\u0445 \u043d\u0435\u043c\u0430\u043b\u043e.<\/p>\n<h3>\u0410 \u0447\u0442\u043e \u0442\u0430\u043c \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 Python?<\/h3>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c re, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438.<\/p>\n<p>  <b>import re<\/b><\/p>\n<p>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0445 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0442\u043e \u0432\u043e\u0442 \u043e\u043d\u0438:<\/p>\n<ul>\n<li> re.match()<\/li>\n<li> re.search()<\/li>\n<li> re.findall()<\/li>\n<li> re.split()<\/li>\n<li> re.sub()<\/li>\n<li> re.compile()<\/li>\n<\/ul>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>  <i><b>re.match(pattern, string)<\/b><\/i><\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u0422\u0430\u043a, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 match() \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 \u00abAV Analytics AV\u00bb \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u00abAV\u00bb, \u0442\u043e \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c. <\/p>\n<pre><code class=\"python\">import re result = re.match(r'AV', 'AV Analytics Vidhya AV') print(result)  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: &lt;_sre.SRE_Match object at 0x0000000009BE4370&gt;<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0438\u0441\u043a\u043e\u043c\u0443\u044e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443. \u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 group(). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u00abr\u00bb \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e raw-\u0441\u0442\u0440\u043e\u043a\u0430 \u0432 Python.<\/p>\n<pre><code class=\"python\">result = re.match(r'AV', 'AV Analytics Vidhya AV') print(result.group(0))   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: AV<\/code><\/pre>\n<p>  \u041e\u043a\u0435\u0439, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u00abAnalythics\u00bb \u0432 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0435. \u0423 \u043d\u0430\u0441 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u00abAV\u00bb, \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 none:<\/p>\n<pre><code class=\"python\">result = re.match(r'Analytics', 'AV Analytics Vidhya AV') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: None<\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434\u044b start() \u0438 end() \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<pre><code class=\"python\">result = re.match(r'AV', 'AV Analytics Vidhya AV') print(result.start()) print(result.end())   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: 0 2<\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0432 \u0445\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<p>  <i><b>re.search(pattern, string)<\/b><\/i><\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 match(), \u043d\u043e \u0435\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0449\u0435\u0442 \u043e\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u0422\u0430\u043a, search() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u00abAnalythics\u00bb.<\/p>\n<pre><code class=\"python\">result = re.search(r'Analytics', 'AV Analytics Vidhya AV') print(result.group(0))   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Analytics<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430 search (), \u0442\u043e \u043e\u043d \u0438\u0449\u0435\u0442 \u043f\u043e \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0432\u043e\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  <i><b>re.findall(pattern, string)<\/b><\/i><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0432\u0441\u0435\u0445 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439. \u0422\u0430\u043a, \u0443 \u043c\u0435\u0442\u043e\u0434\u0430 findall() \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u043b\u0438 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u00abAV\u00bb \u0432 \u0441\u0442\u0440\u043e\u043a\u0435, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0432\u0441\u0435\u0445 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u00abAV\u00bb. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a re.search(), \u0442\u0430\u043a \u0438 \u043a\u0430\u043a re.match().<\/p>\n<pre><code class=\"python\">result = re.findall(r'AV', 'AV Analytics Vidhya AV') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'AV']<\/code><\/pre>\n<p>  <b><i>re.split(pattern, string, [maxsplit=0])<\/i><\/b><\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443.<\/p>\n<pre><code class=\"python\">result = re.split(r'y', 'Analytics') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['Anal', 'tics']<\/code><\/pre>\n<p>  \u0412 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043b\u043e\u0432\u043e \u00abAnalythics\u00bb \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u043e \u0431\u0443\u043a\u0432\u0435 \u00aby\u00bb. \u041c\u0435\u0442\u043e\u0434 split() \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 maxsplit \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0440\u0430\u0432\u043d\u044b\u043c 0. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043d \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041f\u0440\u0430\u0432\u0434\u0430, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437. \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"python\">result = re.split(r'i', 'Analytics Vidhya') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['Analyt', 'cs V', 'dhya'] # \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438.   result = re.split(r'i', 'Analytics Vidhya', maxsplit=1) print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['Analyt', 'cs Vidhya']<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 maxsplit \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0440\u0430\u0432\u043d\u044b\u043c 1, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0440\u0435\u0445.<\/p>\n<p>  <i><b>re.sub(pattern, repl, string)<\/b><\/i><\/p>\n<p>  \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u0441\u0442\u0440\u043e\u043a\u0435, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<pre><code class=\"python\">result = re.sub(r'India', 'the World', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: 'AV is largest Analytics community of the World'<\/code><\/pre>\n<p>  <i><b>re.compile(pattern, repl, string)<\/b><\/i><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430. \u0422\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">pattern = re.compile('AV') result = pattern.findall('AV Analytics Vidhya AV') print(result) result2 = pattern.findall('AV is largest analytics community of India') print(result2)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'AV'] ['AV']<\/code><\/pre>\n<p>  \u0414\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432? \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043d\u0435\u0442, \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u0422\u0430\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a. \u0418 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0435\u0446. \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0412\u043e\u0442 \u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e:<\/p>\n<ul>\n<li>. \u041e\u0434\u0438\u043d \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u043a\u0440\u043e\u043c\u0435 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \\n.<\/li>\n<li>? 0 \u0438\u043b\u0438 1 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0441\u043b\u0435\u0432\u0430<\/li>\n<li>+ 1 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0441\u043b\u0435\u0432\u0430<\/li>\n<li>* 0 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0441\u043b\u0435\u0432\u0430<\/li>\n<li>\\w \u041b\u044e\u0431\u0430\u044f \u0446\u0438\u0444\u0440\u0430 \u0438\u043b\u0438 \u0431\u0443\u043a\u0432\u0430 (\\W \u2014 \u0432\u0441\u0435, \u043a\u0440\u043e\u043c\u0435 \u0431\u0443\u043a\u0432\u044b \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u044b)<\/li>\n<li>\\d \u041b\u044e\u0431\u0430\u044f \u0446\u0438\u0444\u0440\u0430 [0-9] (\\D \u2014 \u0432\u0441\u0435, \u043a\u0440\u043e\u043c\u0435 \u0446\u0438\u0444\u0440\u044b)<\/li>\n<li>\\s \u041b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b (\\S \u2014 \u043b\u044e\u0431\u043e\u0439 \u043d\u0435\u043f\u0440\u043e\u0431\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b)<\/li>\n<li>\\b \u0413\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043b\u043e\u0432\u0430<\/li>\n<li>[..] \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 ([^..] \u2014 \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u043a\u0440\u043e\u043c\u0435 \u0442\u0435\u0445, \u0447\u0442\u043e \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445)<\/li>\n<li>\\ \u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\\. \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0442\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \\+ \u2014 \u0437\u043d\u0430\u043a \u00ab\u043f\u043b\u044e\u0441\u00bb)<\/li>\n<li>^ \u0438 $ \u041d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/li>\n<li>{n,m} \u041e\u0442 n \u0434\u043e m \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 ({,m} \u2014 \u043e\u0442 0 \u0434\u043e m)<\/li>\n<li>a|b \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 a \u0438\u043b\u0438 b<\/li>\n<li>() \u0413\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/li>\n<li>\\t, \\n, \\r \u0421\u0438\u043c\u0432\u043e\u043b \u0442\u0430\u0431\u0443\u043b\u044f\u0446\u0438\u0438, \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u043a\u0430\u0440\u0435\u0442\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/docs.python.org\/3.8\/library\/re.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0434\u043b\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 Python 3.<\/p>\n<h3>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h3>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/b><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c (.)<\/p>\n<pre><code class=\"python\">result = re.findall(r'.', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['A', 'V', ' ', 'i', 's', ' ', 'l', 'a', 'r', 'g', 'e', 's', 't', ' ', 'A', 'n', 'a', 'l', 'y', 't', 'i', 'c', 's', ' ', 'c', 'o', 'm', 'm', 'u', 'n', 'i', 't', 'y', ' ', 'o', 'f', ' ', 'I', 'n', 'd', 'i', 'a']<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b \u043f\u0440\u043e\u0431\u0435\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \\w \u0432\u043c\u0435\u0441\u0442\u043e (.)<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\w', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['A', 'V', 'i', 's', 'l', 'a', 'r', 'g', 'e', 's', 't', 'A', 'n', 'a', 'l', 'y', 't', 'i', 'c', 's', 'c', 'o', 'm', 'm', 'u', 'n', 'i', 't', 'y', 'o', 'f', 'I', 'n', 'd', 'i', 'a']<\/code><\/pre>\n<p>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c * \u0438\u043b\u0438 +.<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\w*', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', '', 'is', '', 'largest', '', 'Analytics', '', 'community', '', 'of', '', 'India', '']<\/code><\/pre>\n<p>  \u041d\u043e \u0438 \u0437\u0434\u0435\u0441\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u2014 * \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00ab\u043d\u043e\u043b\u044c \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\u00bb. &quot;+&quot; \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0438\u0445 \u0443\u0431\u0440\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\w+', 'AV is largest Analytics community of India') print(result) \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'is', 'largest', 'Analytics', 'community', 'of', 'India']<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c<br \/>  ^:<\/p>\n<pre><code class=\"python\">result = re.findall(r'^\\w+', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV']<\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c $ \u0432\u043c\u0435\u0441\u0442\u043e ^, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043b\u043e\u0432\u043e, \u0430 \u043d\u0435 \u043f\u0435\u0440\u0432\u043e\u0435:<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\w+$', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: [\u2018India\u2019]  <\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0434\u0432\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430<\/b><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c, \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435, \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \\w, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0434\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u043a\u0440\u043e\u043c\u0435 \u0442\u0435\u0445, \u0447\u0442\u043e \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438, \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430:<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\w\\w', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'is', 'la', 'rg', 'es', 'An', 'al', 'yt', 'ic', 'co', 'mm', 'un', 'it', 'of', 'In', 'di']<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0434\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043b\u043e\u0432\u0430 (\\b):<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\b\\w.', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'is', 'la', 'An', 'co', 'of', 'In']<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 3. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b.<\/b><\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u043e\u0441\u043b\u0435 @:<\/p>\n<pre><code class=\"python\">result = re.findall(r'@\\w+', 'abc.test@gmail.com, xyz@test.in, test.first@analyticsvidhya.com, first.test@rest.biz') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['@gmail', '@test', '@analyticsvidhya', '@rest']<\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0447\u0430\u0441\u0442\u0438 \u00ab.com\u00bb, \u00ab.in\u00bb \u0438 \u0442. \u0434. \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">result = re.findall(r'@\\w+.\\w+', 'abc.test@gmail.com, xyz@test.in, test.first@analyticsvidhya.com, first.test@rest.biz') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['@gmail.com', '@test.in', '@analyticsvidhya.com', '@rest.biz']<\/code><\/pre>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u044c \u0434\u043e\u043c\u0435\u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c &quot;()&quot;:<\/p>\n<pre><code class=\"python\">result = re.findall(r'@\\w+.(\\w+)', 'abc.test@gmail.com, xyz@test.in, test.first@analyticsvidhya.com, first.test@rest.biz') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['com', 'in', 'com', 'biz']<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 4. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u0442\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/b><\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \\d<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\d{2}-\\d{2}-\\d{4}', 'Amit 34-3456 12-05-2007, XYZ 56-4532 11-11-2011, ABC 67-8945 12-01-2009') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['12-05-2007', '11-11-2011', '12-01-2009']<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043e\u0434, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043a\u043e\u0431\u043a\u0438:<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\d{2}-\\d{2}-(\\d{4})', 'Amit 34-3456 12-05-2007, XYZ 56-4532 11-11-2011, ABC 67-8945 12-01-2009') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['2007', '2011', '2009']<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 5. \u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u0433\u043b\u0430\u0441\u043d\u0443\u044e<\/b><\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430:<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\w+', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'is', 'largest', 'Analytics', 'community', 'of', 'India']<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043b\u0438\u0448\u044c \u0442\u0435, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0431\u0443\u043a\u0432\u044b, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c &quot;[]&quot;:  <\/p>\n<pre><code class=\"python\">result = re.findall(r'[aeiouAEIOU]\\w+', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'is', 'argest', 'Analytics', 'ommunity', 'of', 'India']<\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0443\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u044d\u0442\u043e \u00abargest\u00bb \u0438 \u00abommunity\u00bb. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0445, \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \\b, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043b\u043e\u0432\u0430:  <\/p>\n<pre><code class=\"python\">result = re.findall(r'\\b[aeiouAEIOU]\\w+', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['AV', 'is', 'Analytics', 'of', 'India']<\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 ^ \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b:<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\b[^aeiouAEIOU]\\w+', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: [' is', ' largest', ' Analytics', ' community', ' of', ' India']<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445:<\/p>\n<pre><code class=\"python\">result = re.findall(r'\\b[^aeiouAEIOU ]\\w+', 'AV is largest Analytics community of India') print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['largest', 'community']<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 6. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430<\/b><\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u0438\u043d\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u2014 10 \u0437\u043d\u0430\u043a\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u0441 8 \u0438\u043b\u0438 9. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0445 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c:<\/p>\n<pre><code class=\"python\">li = ['9999999999', '999999-999', '99999x9999']   for val in li:     if re.match(r'[8-9]{1}[0-9]{9}', val) and len(val) == 10:             print('yes')     else:             print('no')   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: yes no no<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 7. \u0420\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f\u043c<\/b><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0412\u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0435:<\/p>\n<pre><code class=\"python\">line = 'asdf fjdk;afed,fjek,asdf,foo' # String has multiple delimiters (&quot;;&quot;,&quot;,&quot;,&quot; &quot;). result = re.split(r'[;,\\s]', line) print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: ['asdf', 'fjdk', 'afed', 'fjek', 'asdf', 'foo']<\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 re.sub() \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">line = 'asdf fjdk;afed,fjek,asdf,foo' result = re.sub(r'[;,\\s]', ' ', line) print(result)   \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: asdf fjdk afed fjek asdf foo<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0440 8. \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 html-\u0444\u0430\u0439\u043b\u0430<\/b><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 html-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043c\u0435\u0436\u0434\u0443  \u0438 , \u043a\u0440\u043e\u043c\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c. \u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e html-\u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430<\/i><\/p>\n<td>1<\/td>\n<td>Noah<\/td>\n<td>Emma<\/td>\n<p>  <\/p>\n<td>2<\/td>\n<td>Liam<\/td>\n<td>Olivia<\/td>\n<p>  <\/p>\n<td>3<\/td>\n<td>Mason<\/td>\n<td>Sophia<\/td>\n<p>  <\/p>\n<td>4<\/td>\n<td>Jacob<\/td>\n<td>Isabella<\/td>\n<p>  <\/p>\n<td>5<\/td>\n<td>William<\/td>\n<td>Ava<\/td>\n<p>  <\/p>\n<td>6<\/td>\n<td>Ethan<\/td>\n<td>Mia<\/td>\n<p>  <\/p>\n<td>7<\/td>\n<td>Michael<\/td>\n<td>Emily<\/td>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">result=re.findall(r'&lt;td&gt;\\w+&lt;\/td&gt;\\s&lt;td&gt;(\\w+)&lt;\/td&gt;\\s&lt;td&gt;(\\w+)&lt;\/td&gt;',str) print(result) Output: [('Noah', 'Emma'), ('Liam', 'Olivia'), ('Mason', 'Sophia'), ('Jacob', 'Isabella'), ('William', 'Ava'), ('Ethan', 'Mia'), ('Michael', 'Emily')]<\/code><\/pre>\n<blockquote><p><b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0410\u043b\u0435\u043a\u0441\u0435\u044f<\/b><\/p>\n<p>  \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043b\u044e\u0431\u044b\u0445 regex \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b:<\/p>\n<ul>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 re.compile \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438 \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0431\u0435\u0433\u0430\u0439\u0442\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 re.compile \u043d\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 regex.<\/li>\n<li>\u041f\u0438\u0448\u0438\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 re.VERBOSE. \u041f\u0440\u0438 re.compile \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0444\u043b\u0430\u0433 re.VERBOSE \u043f\u0438\u0448\u0438\u0442\u0435 regex \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c <a href=\"https:\/\/docs.python.org\/3\/library\/re.html#re.VERBOSE\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/diveintopython3.problemsolving.io\/regular-expressions.html#verbosere\">\u0442\u0443\u0442<\/a>.<\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440:<br \/>  \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0432\u0438\u0434<\/p>\n<pre><code class=\"python\">pattern = '^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$' re.search(pattern, 'MDLV')<\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0434<\/p>\n<pre><code class=\"python\">pattern = &quot;&quot;&quot;     ^                   # beginning of string     M{0,3}              # thousands - 0 to 3 Ms     (CM|CD|D?C{0,3})    # hundreds - 900 (CM), 400 (CD), 0-300 (0 to 3 Cs),                         #            or 500-800 (D, followed by 0 to 3 Cs)     (XC|XL|L?X{0,3})    # tens - 90 (XC), 40 (XL), 0-30 (0 to 3 Xs),                         #        or 50-80 (L, followed by 0 to 3 Xs)     (IX|IV|V?I{0,3})    # ones - 9 (IX), 4 (IV), 0-3 (0 to 3 Is),                         #        or 5-8 (V, followed by 0 to 3 Is)     $                   # end of string     &quot;&quot;&quot; re.search(pattern, 'M\u2019, re.VERBOSE)<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 named capture group \u0434\u043b\u044f \u0432\u0441\u0435\u0445 capture group, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043e\u0434\u043d\u0430 (?P&#8230;). (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u0430 capture, \u0442\u043e\u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c).<br \/>  regex101.com \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u0434\u043b\u044f \u0434\u0435\u0431\u0430\u0433\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 regex<\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e \u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043d\u0430 \u0442\u0435 \u0436\u0435 \u0433\u0440\u0430\u0431\u043b\u0438, \u0447\u0442\u043e \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/460863\/\">\u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b\u0430 Cloudflare<\/a>.<\/p><\/blockquote>\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\/skillbox\/blog\/552360\/\"> https:\/\/habr.com\/ru\/company\/skillbox\/blog\/552360\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d49\/8d3\/817\/d498d381796001c1acbb991bb52bc199.webp\" alt=\"image\"><\/p>\n<p>  \u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, data science \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u044d\u0442\u0438\u043c\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442\u0440\u0430\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0448\u0430\u0433\u043d\u0443\u043b\u0438 \u0432\u043f\u0435\u0440\u0435\u0434. \u0412\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Python \u0438 JavaScript \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c-\u0442\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043d\u0443\u0436\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u0435\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 Twitter \u0438\u043b\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0441\u0432\u043e\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043b <a href=\"https:\/\/habr.com\/ru\/users\/znbiz\/\">\u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u041d\u0435\u043a\u0440\u0430\u0441\u043e\u0432<\/a> \u2014 \u043b\u0438\u0434\u0435\u0440 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Python \u0432 \u041c\u0422\u0421, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Python \u0432 Skillbox. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0433\u0434\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0430 \u0433\u0434\u0435 \u2014 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0446\u0438\u0442\u0430\u0442\u043e\u0439.   <\/p>\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-321437","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321437","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=321437"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321437\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}