{"id":2678,"date":"2022-10-13T16:44:17","date_gmt":"2022-10-13T14:44:17","guid":{"rendered":"https:\/\/digitalia.culturanuova.net\/blog\/?p=2678"},"modified":"2022-10-13T16:46:09","modified_gmt":"2022-10-13T14:46:09","slug":"regex-replace-tags-around-digits","status":"publish","type":"post","link":"https:\/\/digitalia.culturanuova.net\/blog\/?p=2678","title":{"rendered":"Regex replace tags around digits"},"content":{"rendered":"\n<p>If you would replace all <code>&lt;p&gt;[some digits, such as \"10\", or \"23\", or \"348\"]&lt;\/p&gt;<\/code>, you could use this regex code: <\/p>\n\n\n\n<p>search: <code>&lt;p&gt;(.*?\\d{2})&lt;\/p&gt;<\/code><\/p>\n\n\n\n<p>replace:  <code>&lt;h6>\\1&lt;\/h6><\/code><\/p>\n\n\n\n<p>Indeed <code>(.*?)<\/code> is whatever, and <code>(.*?\\d{2})<\/code> is whatever number (with more than two digits).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you would replace all &lt;p&gt;[some digits, such as &#8220;10&#8221;, or &#8220;23&#8221;, or &#8220;348&#8221;]&lt;\/p&gt;, you could use this regex code: search: &lt;p&gt;(.*?\\d{2})&lt;\/p&gt; replace: &lt;h6>\\1&lt;\/h6> Indeed (.*?) is whatever, and (.*?\\d{2}) is whatever number (with more than two digits).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[566],"tags":[780,781,227,643],"class_list":["post-2678","post","type-post","status-publish","format-standard","hentry","category-webmaster","tag-digits","tag-numeri","tag-regex","tag-replace"],"_links":{"self":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2678"}],"version-history":[{"count":3,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2678\/revisions"}],"predecessor-version":[{"id":2681,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2678\/revisions\/2681"}],"wp:attachment":[{"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalia.culturanuova.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}