Files
progcode/web/public/assets/illustrations/preg-match-all-d.svg
T

12 lines
1.6 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="860" height="460" viewBox="0 0 860 460" role="img" aria-label="preg_match_all на D">
<rect width="860" height="460" fill="#f7f4ed"/>
<rect x="24" y="24" width="812" height="412" rx="18" fill="#ffffff" stroke="#242424" stroke-width="2"/>
<rect x="24" y="24" width="812" height="14" rx="7" fill="#be123c"/>
<text x="56" y="82" font-size="30" font-weight="700" fill="#1f2933">preg_match_all на D</text>
<text x="56" y="116" font-size="16" fill="#52606d">Регулярные выражения, группы и позиции совпадений</text>
<rect x="60" y="140" width="740" height="248" rx="14" fill="#111827" stroke="#111827" stroke-width="2"/>
<circle cx="92" cy="164" r="6" fill="#ef4444"/><circle cx="114" cy="164" r="6" fill="#f59e0b"/><circle cx="136" cy="164" r="6" fill="#22c55e"/>
<text x="84" y="178" font-size="17" fill="#d7e3f5" font-family="SFMono-Regular, Menlo, Consolas, monospace">auto r = regex(r&quot;(\\w+)=(\\d+)&quot;);</text><text x="84" y="206" font-size="17" fill="#d7e3f5" font-family="SFMono-Regular, Menlo, Consolas, monospace">auto m = matchAll(&quot;a=1 b=22&quot;, r);</text><text x="84" y="234" font-size="17" fill="#d7e3f5" font-family="SFMono-Regular, Menlo, Consolas, monospace"></text><text x="84" y="262" font-size="17" fill="#d7e3f5" font-family="SFMono-Regular, Menlo, Consolas, monospace">foreach (hit; m) {</text><text x="84" y="290" font-size="17" fill="#d7e3f5" font-family="SFMono-Regular, Menlo, Consolas, monospace"> writeln(hit.captures);</text><text x="84" y="318" font-size="17" fill="#d7e3f5" font-family="SFMono-Regular, Menlo, Consolas, monospace">}</text>
</svg>