Тег TITLE

Извлечение данных с помощью регулярных выражений PHP

Получение данных с помощью функций preg_match() и preg_match_all() .

Текст из скобок

Извлечение содержимого из круглых, квадратных и фигурных скобок:

$text = ' Телеобъектив: диафрагма [ƒ/2.8] Широкоугольный объектив: (диафрагма ƒ/1.8) По беспроводной сети: Поддержка диапазона: '; /* [. ] */ preg_match_all("/\[(.+?)\]/", $text, $matches); print_r($matches[1]); /* (. ) */ preg_match_all("/\((.+?)\)/", $text, $matches); print_r($matches[1]); /* */ preg_match_all("/\<(.+?)\>/", $text, $matches); print_r($matches[1]); /* */ preg_match_all("/\<(.+?)\>/", $text, $matches); print_r($matches[1]);

Результат:

Array ( [0] => ƒ/2.8 ) Array ( [0] => диафрагма ƒ/1.8 ) Array ( [0] => до 13 часов ) Array ( [0] => Dolby Vision и HDR10 )

Текст из HTML тегов

$text = '  

Тег H1

Текст 1

Текст 2

'; /* */ preg_match('/<title[^>]*?>(.*?)/si', $text, $matches); echo $matches[1]; /* <h2>*/ preg_match('/<h1[^>]*?>(.*?)/si', $text, $matches); echo $matches[1]; /* Извлекает текст из всех <p>*/ preg_match_all('/<p[^>]*?>(.*?)/si', $text, $matches); print_r($matches[1]);</code></pre> <h4 id="rezultat-2">Результат:</h4> <pre><code >Тег TITLE Тег H1 Array ( [0] => Текст 1 [1] => Текст 2 )</code></pre> <h2 id="url-iz-teksta"> URL из текста </h2> <pre><code >$text = 'Text http://ya.ru text http://google.ru text.'; preg_match_all('/(http:\/\/|https:\/\/)?(www)?([\da-z\.-]+)\.([a-z\.])([\/\w\.-\?\%\&]*)*\/?/i', $text, $matches); print_r($matches[0]);</code></pre> <h4 id="rezultat-3">Результат:</h4> <pre><code >Array ( [0] => http://ya.ru [1] => http://google.ru )</code></pre> <h2 id="href-iz-ssylok"> href из ссылок </h2> <pre><code >$text = ' Яндекс Google Mail.ru '; preg_match_all('//i', $text, $matches); print_r($matches[1]);</code></pre> <h4 id="rezultat-4">Результат:</h4> <pre><code >Array ( [0] => http://ya.ru [1] => http://google.ru [2] => http://mail.ru )</code></pre> <h2 id="ankory-ssylok"> Анкоры ссылок </h2> <pre><code >$text = ' Яндекс Google Mail.ru '; preg_match_all('/(.*?)/i', $text, $matches); print_r($matches[1]);</code></pre> <h4 id="rezultat-5">Результат:</h4> <pre><code >Array ( [0] => Яндекс [1] => Google [2] => Mail.ru )</code></pre> <h2 id="src-iz-tegov-img"> Src из тегов img </h2> <pre><code >$text = 'text text'; preg_match_all('//is', $text, $matches); print_r($matches[1]);</code></pre> <h4 id="rezultat-6">Результат:</h4> <h2 id="e-mail-adresa-iz-teksta"> E-mail адреса из текста </h2> <pre><code >$text = 'text admin@mail.ru text text text admin@ya.ru'; preg_match_all('/([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]/i', $text, $matches); print_r($matches[0]);</code></pre> <h4 id="rezultat-7">Результат:</h4> <pre><code >Array ( [0] => admin@mail.ru [1] => admin@ya.ru )</code></pre> <h2 id="tsveta"> Цвета </h2> <h3 id="hex-hexa">HEX/HEXA</h3> <pre><code >$css = ' body < color: #000; background: #4545; >header < color: #111111; background: #00000080; >'; preg_match_all('/#(?:[0-9a-f])/i', $css, $matches); print_r($matches[0]);</code></pre> <h4 id="rezultat-8">Результат:</h4> <pre><code >Array ( [0] => #000 [1] => #4545 [2] => #111111 [3] => #00000080 )</code></pre> <h3 id="rgb-rgba">RGB/RGBA</h3> <pre><code >$css = ' body < color: rgb(0,0,0); background: rgba(17,85,68,0.33); >header < color: rgb(17,17,17); background: rgba(0,0,0,0.5); >'; preg_match_all('/((rgba)\((\d,\s?)(1|0?\.?\d+)\)|(rgb)\(\d(,\s?\d)\))/i', $css, $matches); print_r($matches[0]);</code></pre> <pre><code >Array ( [0] => rgb(0,0,0) [1] => rgba(17,85,68,0.33) [2] => rgb(17,17,17) [3] => rgba(0,0,0,0.5) )</code></pre> <p><a href="https://snipp.ru/php/preg-match">Источник</a></p> <h2 id="regulyarnye-vyrazheniya-poisk-ssylok">Регулярные выражения. Поиск ссылок</h2> <p><em><strong>От автора:</strong> приветствую вас, друзья. Из этой статьи вы узнаете, как с помощью регулярных выражений найти в тексте все ссылки и что-то сделать с ними. Например, мы можем их просто вырезать. Или заменить на что-то свое. В общем, с помощью регулярных выражений мы вольны сделать со ссылками в тексте буквально что угодно. Начнем?</em></p> <p>Итак, у нас есть некий текст, в котором, как вы видите ниже, есть пара ссылок.</p> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://webformyself.com/wp-content/uploads/2016/465/1.jpg"/><noscript><img decoding="async" src="https://webformyself.com/wp-content/uploads/2016/465/1.jpg"/></noscript></p> <p>Теперь нам необходим решить классическую задачу в PHP — найти и, скажем, заменить все ссылки на некий текст. Давайте, как обычно, начнем с составления регулярного выражения, которое найдет все ссылки в данном массиве текста. Ну а затем разберем составленный шаблон регулярного выражения.</p><script data-noptimize="" data-wpfc-render="false"> /* <![CDATA[ */ fpm_start( "true" ); /* ]]> */ </script> <p>Вариант шаблона может выглядеть так:</p> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://webformyself.com/wp-content/themes/web4my/images/s/php-p-o.jpg"/><noscript><img decoding="async" src="https://webformyself.com/wp-content/themes/web4my/images/s/php-p-o.jpg"/></noscript></p> <p>Онлайн курс «PHP-разработчик»</p> <p>Изучите курс и создайте полноценный проект — облачное хранилище файлов</p> <p>С нуля освоите язык программирования PHP, структурируете имеющиеся знания, а эксперты помогут разобраться с трудными для понимания темами, попрактикуетесь на реальных задачах. Напишете первый проект для портфолио.</p> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://webformyself.com/wp-content/uploads/2016/465/2.jpg"/><noscript><img decoding="async" src="https://webformyself.com/wp-content/uploads/2016/465/2.jpg"/></noscript></p> <p>Как видим, он отработал корректно и все ссылки были найдены. Давайте теперь разберем его.</p> <p>«[^>]+»> — эта часть совпадает со значением атрибута href. Обратите внимание, внутри символьного класса — [] — мы использовали уже знакомый нам метасимвол ^, который в начале шаблона означает начало строки. Однако в начале символьного класса метасимвол ^ уже означает отрицание, т.е. в данном случае мы говорим, что в кавычках может быть любой символ (один и более), кроме >. В итоге две озвученные части шаблона совпадут со следующей строкой — ;</p> <p>.+? — эта часть шаблона совпадет с анкором ссылки. Здесь есть уже знакомая нам конструкция — .+ — точка совпадает с любым символом, а квантификатор + позволяет найти 1 и более таких символов. А что за вопросительный знак? Он делает наш шаблон нежадным. Попробуйте убрать его и посмотрите, что получится в итоге;</p> <p> — последняя часть шаблона совпадет с закрывающим тегом ссылки. Здесь мы обязательно экранируем слеш, поскольку слеш использован нами в качестве ограничителей шаблона. Если бы в качестве ограничителей мы использовали, к примеру, # — необходимости в экранировании слеша не было бы.</p> <p>Теперь осталось просто заменить найденные ссылки на то, что нам нужно.</p> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://webformyself.com/wp-content/uploads/2016/465/3.jpg"/><noscript><img decoding="async" src="https://webformyself.com/wp-content/uploads/2016/465/3.jpg"/></noscript></p> <p>Все получилось! Это был простейший пример. На самом деле регулярные выражения позволяют гораздо более гибко решать задачу. Например, мы можем заменить только анкор (текст ссылки). Или только URL ссылки, оставив анкор нетронутым. Больше о регулярных выражениях вы можете узнать из нашего курса по регулярным выражениям.</p> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://webformyself.com/wp-content/themes/web4my/images/s/php-p-o.jpg"/><noscript><img decoding="async" src="https://webformyself.com/wp-content/themes/web4my/images/s/php-p-o.jpg"/></noscript></p> <p>Онлайн курс «PHP-разработчик»</p> <p>Изучите курс и создайте полноценный проект — облачное хранилище файлов</p> <p>С нуля освоите язык программирования PHP, структурируете имеющиеся знания, а эксперты помогут разобраться с трудными для понимания темами, попрактикуетесь на реальных задачах. Напишете первый проект для портфолио.</p> <p>На этом мы будем завершать сегодняшнюю статью. Удачи!</p> <p><a href="https://webformyself.com/regulyarnye-vyrazheniya-poisk-ssylok/">Источник</a></p> <h2 id="kak-poluchit-vse-ssylki-so-stranitsy-regulyarnymi">Как получить все ссылки со страницы регулярными выражениями?</h2> <p>Здравствуйте, скажите пожалуйста как получить все ссылки со страницы регулярными выражениями?</p> <p><i>Добавлено через 6 минут</i> </p> <pre><span > <span >$contents</span><span >=</span><span >file_get_contents</span> <span >(</span><span >trim</span><span >(</span><span >'http://site.ru/'</span><span >)</span><span >)</span><span >;</span> <span >echo</span> <span >$contents</span><span >;</span> <span >?></span></pre> <p><strong>Как убрать http из домена регулярными выражениями</strong><br/>Здравствуйте, уважаемые форумчане. Скажите, как можно убрать из урл вида http://site.ru/ или.</p> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://cyberstatic.net/images/misc/tick.png"/><noscript><img decoding="async" src="https://cyberstatic.net/images/misc/tick.png"/></noscript></p> <p> <strong>Как найти регулярными выражениями перенос строки?</strong><br/><tr> <td >Строка 1</td> <td >Строка 2</td> <td >Строка 3</td> <td >Строка 4</td> </tr> .</p> <p><strong>Работа с регулярными выражениями</strong><br/>Мне нужно получить из страницы определенные куски текста. т.е. надо найти такой кусок <TR.</p> <pre><span >$contents</span> <span >=</span> <span >file_get_contents</span><span >(</span><span >"htp://site.ru/"</span><span >)</span><span >;</span> <span >preg_match_all</span><span >(</span><span >'/href="([^"]+)"/'</span><span >,</span> <span >$contents</span><span >,</span> <span >$links</span><span >)</span><span >;</span> <span >foreach</span><span >(</span> <span >$links</span> <span >as</span> <span >$key</span> <span >=></span> <span >$link</span> <span >)</span> <span >echo</span> <span >$link</span><span >[</span><span >1</span><span >]</span><span >.</span><span >"<br/>"</span><span >;</span></pre> <p><img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" alt="Цитата" data-lazy-src="https://cyberstatic.net/images/buttons/quote_icon.png"/><noscript><img decoding="async" src="https://cyberstatic.net/images/buttons/quote_icon.png" alt="Цитата"/></noscript>Сообщение от <strong>tolimadokara</strong> <img decoding="async" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" alt="Посмотреть сообщение" data-lazy-src="https://cyberstatic.net/images/buttons/viewpost-right.png"/><noscript><img decoding="async" src="https://cyberstatic.net/images/buttons/viewpost-right.png" alt="Посмотреть сообщение"/></noscript></p> <pre><span >$contents</span> <span >=</span> <span >file_get_contents</span><span >(</span><span >"htp://site.ru/"</span><span >)</span><span >;</span> <span >preg_match_all</span><span >(</span><span >'/href="([^"]+)"/'</span><span >,</span> <span >$contents</span><span >,</span> <span >$links</span><span >)</span><span >;</span> <span >foreach</span><span >(</span> <span >$links</span> <span >as</span> <span >$key</span> <span >=></span> <span >$link</span> <span >)</span> <span >echo</span> <span >$link</span><span >[</span><span >1</span><span >]</span><span >.</span><span >"<br/>"</span><span >;</span></pre> <p>качаем phpQuery-onefile.php потом. как фантазия позволяет.. <br/>можно так(кусок моего класса для парсинга койчего, не только можно ссылки искать):</p> <pre>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27</pre> <pre><span > <span >require_once</span> <span >'phpQuery-onefile.php'</span><span >;</span> <span >class</span> HtmlParser <span >{</span> <span >private</span> <span >$html</span><span >;</span> <span >public</span> <span >function</span> __construct<span >(</span><span >$html</span><span >)</span> <span >{</span> <span >$this</span><span >-></span><span >html</span><span >=</span><span >$html</span><span >;</span> <span >}</span> <span >public</span> <span >function</span> getLinks<span >(</span><span >)</span><span >{</span> <span >$links</span><span >=</span><span >array</span><span >(</span><span >)</span><span >;</span> <span >if</span><span >(</span><span >!</span><span >$this</span><span >-></span><span >html</span><span >)</span> <span >return</span> <span >false</span><span >;</span> <span >$doc</span> <span >=</span> phpQuery<span >::</span><span >newDocument</span><span >(</span><span >$this</span><span >-></span><span >html</span><span >)</span><span >;</span> <span >foreach</span><span >(</span><span >$doc</span><span >-></span><span >find</span><span >(</span><span >'a'</span><span >)</span> <span >as</span> <span >$a</span><span >)</span><span >{</span> <span >$buf</span><span >=</span><span >trim</span><span >(</span>pq<span >(</span><span >$a</span><span >)</span><span >-></span><span >text</span><span >(</span><span >)</span><span >)</span><span >;</span> <span >if</span><span >(</span><span >strlen</span><span >(</span><span >$buf</span><span >)</span><span >==</span><span >0</span><span >)</span><span >{</span> <span >$buf</span><span >=</span>pq<span >(</span><span >$a</span><span >)</span><span >-></span><span >attr</span><span >(</span><span >'href'</span><span >)</span><span >;</span> <span >}</span> <span >$links</span><span >[</span>pq<span >(</span><span >$a</span><span >)</span><span >-></span><span >attr</span><span >(</span><span >'href'</span><span >)</span><span >]</span> <span >=</span> <span >$buf</span><span >;</span> <span >}</span> <span >return</span> <span >$links</span><span >;</span> <span >}</span> <span >}</span> <span >?></span></pre> <p>а регулярки я бы использовал для обработки обычных текстов, не содержащих служебных символов. при наличии оных изза экранирования символов регулярка становится нечитаемой. дело вкуса конечно..</p> <p><a href="https://www.cyberforum.ru/php-regex/thread761589.html">Источник</a></p> <h2 id="php-parsing-html-to-find-links">PHP: Parsing HTML to find Links</h2> <p>From blogging to log analysis and search engine optimisation (SEO) people are looking for scripts that can parse web pages and RSS feeds from other websites — to see where their traffic is coming from among other things.</p> <p>Parsing your own HTML should be no problem — assuming that you use consistent formatting — but once you set your sights at parsing other people’s HTML the frustration really sets in. This page presents some regular expressions and a commentary that will hopefully point you in the right direction.</p> <h2 id="simplest-case">Simplest Case</h2> <p>Let’s start with the simplest case — a well formatted link with no extra attributes:</p> <p>This, believe it or not, is a very simple regular expression (or «regexp» for short). It can be broken down as follows:</p> <p>We’re also using two ‘pattern modifiers’:</p> <p>One shortcoming of this regexp is that it won’t match link tags that include a line break — fortunately there’s a modifer for this as well:</p> <p>Now the ‘.’ character will match any character <strong>including</strong> line breaks. We’ve also changed the first space to a ‘whitespace’ character type so that it can match a space, tab or line break. It’s necessary to have some kind of whitespace in that position so we don’t match other tags such as .</p> <p>For more information on pattern modifiers see the link at the bottom of this page.</p> <h2 id="room-for-extra-attributes">Room for Extra Attributes</h2> <p>Most link tags contain a lot more than just an <tt>href</tt> attribute. Other common attributes include: rel, target and title. They can appear before or after the href attribute:</p> <p>We’ve added extra patterns before and after the href attribute. They will match any series of characters NOT containing the <tt>></tt> symbol. It’s always better when writing regular expressions to specify <strong>exactly</strong> which characters are allowed and not allowed — 0rather that using the wildcard (‘.’) character.</p> <h2 id="allow-for-missing-quotes">Allow for Missing Quotes</h2> <p>Up to now we’ve assumed that the link address is going to be enclosed in double-quotes. Unfortunately there’s nothing enforcing this so a lot of people simply leave them out. The problem is that we were relying on the quotes to be there to indicate where the address starts <b>and</b> ends. Without the quotes we have a problem.</p> <p>It would be simple enough (even trivial) to write a second regexp, but where’s the fun in that when we can do it all with one:</p> <p>What can I say? Regular expressions are a lot of fun to work with but when it takes a half-hour to work out where to put an extra <tt>?</tt> your really know you’re in deep.</p> <p>Firstly, what’s with those extra <tt>?</tt>‘s?</p> <p>Because we used the <tt>U</tt> modifier, all patterns in the regexp default to ‘ungreedy’. Adding an extra <tt>?</tt> after a <tt>?</tt> or <tt>*</tt> reverses that behaviour back to ‘greedy’ but just for the preceding pattern. Without this, for reasons that are difficult to explain, the expression fails. Basically anything following <tt>href=</tt> is lumped into the <tt>[^>]*</tt> expression.</p> <p>We’ve added an extra capture to the regexp that matches a double-quote if it’s there: <tt>(\"??)</tt>. There is then a backreference <tt>\\1</tt> that matches the closing double-quote — if there was an opening one.</p> <p>To cater for links without quotes, the pattern to match the link address itself has been changed from <tt>[^\"]*</tt> to <tt>[^\" >]*?</tt>. That means that the link can be terminated by not just a double-quote (the previous behaviour) but also a space or <tt>></tt> symbol.</p> <p><b>This means that links with addresses containing unescaped spaces will no longer be captured!</b></p> <h2 id="refining-the-regexp">Refining the Regexp</h2> <p>Given the nature of the WWW there are always going to be cases where the regular expression breaks down. Small changes to the patterns can fix these.</p> <h4 id="spaces-around-the-after-href">spaces around the <tt>=</tt> after href:</h4> <h4 id="matching-only-links-starting-with-http">matching only links starting with http:</h4> <h4 id="single-quotes-around-the-link-address">single quotes around the link address:</h4> <p>And yes, all of these modifications can be used at the same time to make one super-regexp, but the result is just too painful to look at so I’ll leave that as an exercise.</p> <p><small><b>Note:</b> All of the expressions on this page have been tested to some extent, but mistakes can occur in transcribing so please report any errors you may have found when implementing these examples.</small></p> <h2 id="using-the-regular-expression-to-parse-html">Using the Regular Expression to parse HTML</h2> <p>Using the default for preg_match_all the array returned contains an array of the first ‘capture’ then an array of the second capture and so forth. By capture we mean patterns contained in <tt>()</tt>:</p> <p>Using <tt>PREG_SET_ORDER</tt> each link matched has it’s own array in the return value:</p> <p>If you find any cases where this code falls down, let us know using the Feedback link below.</p> <p>Before using this or similar scripts to fetch pages from other websites, we suggest you read through the related article on setting a user agent and parsing robots.txt.</p> <h2 id="first-checking-robots-txt">First checking robots.txt</h2> <p>As mentioned above, before using a script to download files you should always check the robots.txt file. Here we’re making use of the <tt>robots_allowed</tt> function from the article linked above to determine whether we’re allowed to access files:</p> <p>Now you’re well on the way to building a professional web spider. If you’re going to use this in practice you might want to look at: caching the robots.txt file so that it’s not downloaded every time (a la Slurp); checking the server headers and server response codes; and adding a pause between multiple requests — for starters.</p> <h2 id="translations">Translations</h2> <h2 id="references">References</h2> <h2 id="related-articles-parsing-files">Related Articles — Parsing files</h2> <p><a href="https://www.the-art-of-web.com/php/parse-links/">Источник</a></p> <div class="fpm_end"></div><div style="clear:both; margin-top:0em; margin-bottom:1em;"><a href="https://indeksstroy.ru/python-str-join-objects/" target="_blank" rel="dofollow" class="u92f97fbf9557be7973a2530f7b3c56fc"><!-- INLINE RELATED POSTS 1/3 //--><style> .u92f97fbf9557be7973a2530f7b3c56fc { padding:0px; margin: 0; padding-top:1em!important; padding-bottom:1em!important; width:100%; display: block; font-weight:bold; background-color:#eaeaea; border:0!important; border-left:4px solid #34495E!important; text-decoration:none; } .u92f97fbf9557be7973a2530f7b3c56fc:active, .u92f97fbf9557be7973a2530f7b3c56fc:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; text-decoration:none; } .u92f97fbf9557be7973a2530f7b3c56fc { transition: background-color 250ms; webkit-transition: background-color 250ms; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; } .u92f97fbf9557be7973a2530f7b3c56fc .ctaText { font-weight:bold; color:#464646; text-decoration:none; font-size: 16px; } .u92f97fbf9557be7973a2530f7b3c56fc .postTitle { color:#000000; text-decoration: underline!important; font-size: 16px; } .u92f97fbf9557be7973a2530f7b3c56fc:hover .postTitle { text-decoration: underline!important; } </style><div style="padding-left:1em; padding-right:1em;"><span class="ctaText">Читайте также:</span>  <span class="postTitle">Python str join objects</span></div></a></div> </div><!-- .entry-content --> </article> <div class="rating-box"> <div class="rating-box__header">Оцените статью</div> <div class="wp-star-rating js-star-rating star-rating--score-0" data-post-id="181902" data-rating-count="0" data-rating-sum="0" data-rating-value="0"><span class="star-rating-item js-star-rating-item" data-score="1"><svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="i-ico"><path fill="currentColor" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" class="ico-star"></path></svg></span><span class="star-rating-item js-star-rating-item" data-score="2"><svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="i-ico"><path fill="currentColor" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" class="ico-star"></path></svg></span><span class="star-rating-item js-star-rating-item" data-score="3"><svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="i-ico"><path fill="currentColor" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" class="ico-star"></path></svg></span><span class="star-rating-item js-star-rating-item" data-score="4"><svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="i-ico"><path fill="currentColor" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" class="ico-star"></path></svg></span><span class="star-rating-item js-star-rating-item" data-score="5"><svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="i-ico"><path fill="currentColor" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" class="ico-star"></path></svg></span></div> </div> <div class="entry-social"> <div class="social-buttons"><span class="social-button social-button--vkontakte" data-social="vkontakte" data-image=""></span><span class="social-button social-button--facebook" data-social="facebook"></span><span class="social-button social-button--telegram" data-social="telegram"></span><span class="social-button social-button--odnoklassniki" data-social="odnoklassniki"></span><span class="social-button social-button--twitter" data-social="twitter"></span><span class="social-button social-button--sms" data-social="sms"></span><span class="social-button social-button--whatsapp" data-social="whatsapp"></span></div> </div> <meta itemprop="author" content="admin"> <meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://indeksstroy.ru/teg-title-23/" content="Тег TITLE"> <meta itemprop="dateModified" content="2023-08-27"> <meta itemprop="datePublished" content="2023-08-29T16:09:01+03:00"> <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization" style="display: none;"><meta itemprop="name" content="Программирование"><meta itemprop="telephone" content="Программирование"><meta itemprop="address" content="https://indeksstroy.ru"></div> </main><!-- #main --> </div><!-- #primary --> <aside id="secondary" class="widget-area" itemscope itemtype="http://schema.org/WPSideBar"> <div class="sticky-sidebar js-sticky-sidebar"> <div id="block-2" class="widget widget_block"><div class="flatPM_sidebar" data-top="70"> <div id="Q_sidebar"></div> </div></div> </div> </aside><!-- #secondary --> <div id="related-posts" class="related-posts fixed"><div class="related-posts__header">Вам также может понравиться</div><div class="post-cards post-cards--vertical"> <div class="post-card post-card--related post-card--thumbnail-no"> <div class="post-card__title"><a href="https://indeksstroy.ru/yaschiki-s-usami-python/">Ящики с усами python</a></div><div class="post-card__description">pandas.plotting.boxplot# Make a box-and-whisker plot</div> </div> <div class="post-card post-card--related post-card--thumbnail-no"> <div class="post-card__title"><a href="https://indeksstroy.ru/primer-ispolzovaniya-svoystva-css-table-layout-74/">Пример использования свойства CSS table-layout.</a></div><div class="post-card__description">table-layout¶ Свойство table-layout определяет, как</div> </div> <div class="post-card post-card--related post-card--thumbnail-no"> <div class="post-card__title"><a href="https://indeksstroy.ru/primer-ispolzovaniya-svoystva-css-table-layout-73/">Пример использования свойства CSS table-layout.</a></div><div class="post-card__description">HTML Размеры таблицы HTML таблицы могут иметь разные</div> </div> <div class="post-card post-card--related post-card--thumbnail-no"> <div class="post-card__title"><a href="https://indeksstroy.ru/primer-ispolzovaniya-svoystva-css-table-layout-72/">Пример использования свойства CSS table-layout.</a></div><div class="post-card__description">table-layout¶ Свойство table-layout определяет, как</div> </div> </div></div> </div><!--.site-content-inner--> </div><!--.site-content--> <div class="site-footer-container "> <div class="footer-navigation fixed" itemscope itemtype="http://schema.org/SiteNavigationElement"> <div class="main-navigation-inner full"> <div class="menu-tehnicheskoe-menyu-container"><ul id="footer_menu" class="menu"><li id="menu-item-12637" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12637"><a href="https://indeksstroy.ru/pravoobladatelyam/">Правообладателям</a></li> <li id="menu-item-12638" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12638"><a href="https://indeksstroy.ru/politika-konfidentsialnosti/">Политика конфиденциальности</a></li> <li id="menu-item-12639" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12639"><a href="https://indeksstroy.ru/kontakty/">Контакты</a></li> </ul></div> </div> </div><!--footer-navigation--> <footer id="colophon" class="site-footer site-footer--style-gray full"> <div class="site-footer-inner fixed"> <div class="footer-bottom"> <div class="footer-info"> © 2024 Программирование </div> <div class="footer-counters"><!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(98905868, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98905868" style="position:absolute; left:-9999px;" alt=""/></div></noscript> <!-- /Yandex.Metrika counter --></div></div> </div> </footer><!--.site-footer--> </div> <button type="button" class="scrolltop js-scrolltop"></button> </div><!-- #page --> <script>var pseudo_links = document.querySelectorAll(".pseudo-clearfy-link");for (var i=0;i<pseudo_links.length;i++ ) { pseudo_links[i].addEventListener("click", function(e){ window.open( e.target.getAttribute("data-uri") ); }); }</script><script type="text/javascript" id="reboot-scripts-js-extra"> /* <![CDATA[ */ var settings_array = {"rating_text_average":"\u0441\u0440\u0435\u0434\u043d\u0435\u0435","rating_text_from":"\u0438\u0437","lightbox_display":"1","sidebar_fixed":"1"}; var wps_ajax = {"url":"https:\/\/indeksstroy.ru\/wp-admin\/admin-ajax.php","nonce":"892cdd8a27"}; /* ]]> */ </script> <script type="text/javascript" src="https://indeksstroy.ru/wp-content/themes/reboot/assets/js/scripts.min.js" id="reboot-scripts-js"></script> <script>window.lazyLoadOptions = [{ elements_selector: "img[data-lazy-src],.rocket-lazyload,iframe[data-lazy-src]", data_src: "lazy-src", data_srcset: "lazy-srcset", data_sizes: "lazy-sizes", class_loading: "lazyloading", class_loaded: "lazyloaded", threshold: 300, callback_loaded: function(element) { if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) { if (element.classList.contains("lazyloaded") ) { if (typeof window.jQuery != "undefined") { if (jQuery.fn.fitVids) { jQuery(element).parent().fitVids(); } } } } }},{ elements_selector: ".rocket-lazyload", data_src: "lazy-src", data_srcset: "lazy-srcset", data_sizes: "lazy-sizes", class_loading: "lazyloading", class_loaded: "lazyloaded", threshold: 300, }]; window.addEventListener('LazyLoad::Initialized', function (e) { var lazyLoadInstance = e.detail.instance; if (window.MutationObserver) { var observer = new MutationObserver(function(mutations) { var image_count = 0; var iframe_count = 0; var rocketlazy_count = 0; mutations.forEach(function(mutation) { for (var i = 0; i < mutation.addedNodes.length; i++) { if (typeof mutation.addedNodes[i].getElementsByTagName !== 'function') { continue; } if (typeof mutation.addedNodes[i].getElementsByClassName !== 'function') { continue; } images = mutation.addedNodes[i].getElementsByTagName('img'); is_image = mutation.addedNodes[i].tagName == "IMG"; iframes = mutation.addedNodes[i].getElementsByTagName('iframe'); is_iframe = mutation.addedNodes[i].tagName == "IFRAME"; rocket_lazy = mutation.addedNodes[i].getElementsByClassName('rocket-lazyload'); image_count += images.length; iframe_count += iframes.length; rocketlazy_count += rocket_lazy.length; if(is_image){ image_count += 1; } if(is_iframe){ iframe_count += 1; } } } ); if(image_count > 0 || iframe_count > 0 || rocketlazy_count > 0){ lazyLoadInstance.update(); } } ); var b = document.getElementsByTagName("body")[0]; var config = { childList: true, subtree: true }; observer.observe(b, config); } }, false);</script><script data-no-minify="1" async src="https://indeksstroy.ru/wp-content/plugins/rocket-lazy-load/assets/js/16.1/lazyload.min.js"></script><script>function lazyLoadThumb(e,alt){var t='<img loading="lazy" src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360">',a='<button class="play" aria-label="play Youtube video"></button>';t=t.replace('alt=""','alt="'+alt+'"');return t.replace("ID",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement("iframe"),t="ID?autoplay=1";t+=0===this.parentNode.dataset.query.length?'':'&'+this.parentNode.dataset.query;e.setAttribute("src",t.replace("ID",this.parentNode.dataset.src)),e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","1"),e.setAttribute("allow", "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),this.parentNode.parentNode.replaceChild(e,this.parentNode)}document.addEventListener("DOMContentLoaded",function(){var e,t,p,a=document.getElementsByClassName("rll-youtube-player");for(t=0;t<a.length;t++)e=document.createElement("div"),e.setAttribute("data-id",a[t].dataset.id),e.setAttribute("data-query", a[t].dataset.query),e.setAttribute("data-src", a[t].dataset.src),e.innerHTML=lazyLoadThumb(a[t].dataset.id,a[t].dataset.alt),a[t].appendChild(e),p=e.querySelector('.play'),p.onclick=lazyLoadYoutubeIframe});</script> </body> </html>