{"id":281,"date":"2020-01-19T18:12:43","date_gmt":"2020-01-19T17:12:43","guid":{"rendered":"http:\/\/blog.mhasin.eu\/?p=281"},"modified":"2020-01-19T18:12:43","modified_gmt":"2020-01-19T17:12:43","slug":"mysql-vycitanie-cisla-z-textu-text-cislo-pomocou-regext","status":"publish","type":"post","link":"https:\/\/blog.mhasin.eu\/?p=281","title":{"rendered":"MYSQL vy\u010d\u00edtanie \u010d\u00edsla z textu  *text:  cislo* pomocou regext"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Pre vy\u010d\u00edtanie a porovnanie \u010d\u00edsla v tabu\u013eke s hodnotami je mo\u017ene pou\u017ei\u0165 regexp a substring_index<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>drop table if exists t;\ncreate table t (col varchar(100));\ninsert into t values ('Description Number 9 MOre description');\ninsert into t values ('Description Number 549 MOre description');\ninsert into t values ('Description Number 549 MOre description');\ninsert into t values ('Description Number asd MOre description');\n\n\nselect \n    case \n        when col regexp '.*Number &#91;0-9]+.*' \n        then substring_index(substring_index(col, 'Number ', -1), ' ', 1)\n    end \nfrom t;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Vyst\u00fap funkcie:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"954\" height=\"142\" src=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/01\/image-3.png\" alt=\"\" class=\"wp-image-282\" srcset=\"https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/01\/image-3.png 954w, https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/01\/image-3-300x45.png 300w, https:\/\/blog.mhasin.eu\/wp-content\/uploads\/2020\/01\/image-3-768x114.png 768w\" sizes=\"auto, (max-width: 954px) 100vw, 954px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Live k\u00f3d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;rextester.com\/EJX96105<\/code><\/pre>\n<div class=\"pdf24Plugin-cp\"> \t<form name=\"pdf24Form0\" method=\"post\" action=\"https:\/\/doc2pdf.pdf24.org\/wordpress.php\" target=\"pdf24PopWin\" onsubmit=\"var pdf24Win = window.open('about:blank', 'pdf24PopWin', 'resizable=yes,scrollbars=yes,width=600,height=250,left='+(screen.width\/2-300)+',top='+(screen.height\/3-125)+''); pdf24Win.focus(); if(typeof pdf24OnCreatePDF === 'function'){void(pdf24OnCreatePDF(this,pdf24Win));}\"> \t\t<input type=\"hidden\" name=\"blogCharset\" value=\"Cw1x07UAAA==\" \/><input type=\"hidden\" name=\"blogPosts\" value=\"MwQA\" \/><input type=\"hidden\" name=\"blogUrl\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLQUA\" \/><input type=\"hidden\" name=\"blogName\" value=\"c\/LxdwcA\" \/><input type=\"hidden\" name=\"blogValueEncoding\" value=\"gzdeflate base64\" \/><input type=\"hidden\" name=\"postId_0\" value=\"M7IwBAA=\" \/><input type=\"hidden\" name=\"postTitle_0\" value=\"840MDvRRKKs80nt4bUliXmaqAohVnJOoUKVQklpRUqqgoAWirRQUkjOLc\/K1FAryc\/OT80sVilLTgeIA\" \/><input type=\"hidden\" name=\"postLink_0\" value=\"yygpKSi20tdPyslP18vNSCzOzNNLLdW3L7A1sjAEAA==\" \/><input type=\"hidden\" name=\"postAuthor_0\" value=\"y00syfcwNAIA\" \/><input type=\"hidden\" name=\"postDateTime_0\" value=\"MzIwMtA1MNQ1tFQwtLAyMLQyMQYA\" \/><input type=\"hidden\" name=\"postContent_0\" value=\"xVQ9b9swEN31Kw4MENupZUmOncSfU7sE\/ZqKLkVBU2eJtUQSJCXL+Q\/9GR07deuQxfH\/KiUbTWsERdoMvUG6E3XvPfKe5E0VsIwaMyNr5S8yyVa+opommqqUzN9qhHJz93n71VLBESgoqWUpmqJ+bDIKJVi6KO5uVwgGUhkLaWnO4RNCLne3Al1Psbvluy+gMcFKORRTLIzVXCQfuYixmgZq7rmYKsd3LIfJGMl8Wt\/msZaqZssQ+BKw4sYasBOPaaQWDysW2kxmUFLNUqrbURh2OhOPC4PaAhdWujdKmhVooN16joZpriyXAl4X+QI1jODVG6cjvl9p\/VX\/cPD\/EaiJH0TwPIMZMgseuGDU4D6rY52igPrkDmNq9c4OaKcno2gS+qMPz3pnrfsGWzccjbJ9XDvALrQOQK0u+FHH1XUWdRokFDF4Sy1zN8hp0IzZ+UHjwRF\/sue7jbHb7wqWhVgxjuOfPlrypHjASjyniTMpv0E\/ozqpbcXzBDJJYyd4RjJ6syHuyJyIpqZmIxiBNY9tOiOj4YBAijxJ7YxEgz4Bo9mMpNYqMw4CR5H08pQaLnpYBI6USWFR2KBQNYMJ+mE\/DMIoaGT45z0lEgI0c2jkF6n71f7VHt+gfSIFON3rLvwzhn8ehtVg2EC59ElQlxdXVRQNGiyXr0kzDLdvWljZhXZOK7857XGtWlUdcF9v6SibikDgrLGf7SPc8ZKXCKvtt3j86P\/LfmenJ4PLSXPRWFk0FnWPyTx4cf1+dBGFw99d+gM=\" \/> \t\t<a href=\"https:\/\/www.pdf24.org\" target=\"_blank\" title=\"www.pdf24.org\" rel=\"nofollow\"><img src=\"https:\/\/blog.mhasin.eu\/wp-content\/plugins\/pdf24-post-to-pdf\/img\/pdf_32x32.png\" alt=\"\" border=\"0\" height=\"32\" \/><\/a> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<span class=\"pdf24Plugin-cp-text\">Send article as PDF<\/span> \t\t<span class=\"pdf24Plugin-cp-space\">&nbsp;&nbsp;<\/span> \t\t<input class=\"pdf24Plugin-cp-input\" style=\"margin: 0px;\" type=\"text\" name=\"sendEmailTo\" placeholder=\"Enter email address\" \/> \t\t<input class=\"pdf24Plugin-cp-submit\" style=\"margin: 0px;\" type=\"submit\" value=\"Send\" \/> \t<\/form> <\/div>","protected":false},"excerpt":{"rendered":"Pre vy\u010d\u00edtanie a porovnanie \u010d\u00edsla v tabu\u013eke s hodnotami je mo\u017ene pou\u017ei\u0165 regexp a substring_index Vyst\u00fap funkcie: Live k\u00f3d: &nbsp;&nbsp; Send article as PDF &nbsp;&nbsp;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"arc_restricted_post":false,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-281","post","type-post","status-publish","format-standard","hentry","category-programovanie"],"_links":{"self":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=281"}],"version-history":[{"count":1,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/281\/revisions"}],"predecessor-version":[{"id":283,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=\/wp\/v2\/posts\/281\/revisions\/283"}],"wp:attachment":[{"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhasin.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}