{"id":5902,"date":"2021-02-22T13:55:33","date_gmt":"2021-02-22T13:55:33","guid":{"rendered":"https:\/\/www.codebee.co.th\/labs\/?p=5902"},"modified":"2021-02-22T13:55:35","modified_gmt":"2021-02-22T13:55:35","slug":"%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-regular-expression-is-too-large","status":"publish","type":"post","link":"https:\/\/www.codebee.co.th\/labs\/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b9%81%e0%b8%81%e0%b9%89%e0%b8%9b%e0%b8%b1%e0%b8%8d%e0%b8%ab%e0%b8%b2-regular-expression-is-too-large\/","title":{"rendered":"\u0e27\u0e34\u0e18\u0e35\u0e41\u0e01\u0e49\u0e1b\u0e31\u0e0d\u0e2b\u0e32 regular expression is too large"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0e1b\u0e31\u0e0d\u0e2b\u0e32 regular expression is too large \u0e43\u0e19 PHP \u0e19\u0e31\u0e49\u0e19\u0e40\u0e01\u0e34\u0e14\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e2b\u0e25\u0e32\u0e22\u0e01\u0e23\u0e13\u0e35 \u0e41\u0e15\u0e48\u0e2a\u0e32\u0e40\u0e2b\u0e15\u0e38\u0e2b\u0e25\u0e31\u0e01\u0e02\u0e2d\u0e07 Warning \u0e19\u0e31\u0e49\u0e19 \u0e21\u0e32\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e21\u0e35\u0e1b\u0e23\u0e34\u0e21\u0e32\u0e13\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e21\u0e32\u0e01\u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e19\u0e33\u0e44\u0e1b\u0e1c\u0e48\u0e32\u0e19\u0e01\u0e23\u0e30\u0e1a\u0e27\u0e19\u0e01\u0e32\u0e23 regular expression \u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e48\u0e32\u0e07 \u0e46 \u0e40\u0e0a\u0e48\u0e19 \u0e01\u0e32\u0e23\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e01\u0e32\u0e23\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e2d\u0e35\u0e40\u0e21\u0e25 \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0e27\u0e34\u0e18\u0e35\u0e41\u0e01\u0e49\u0e1b\u0e31\u0e0d\u0e2b\u0e32 regular expression is too large<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e27\u0e34\u0e18\u0e35\u0e41\u0e01\u0e49\u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e04\u0e37\u0e2d \u0e01\u0e32\u0e23\u0e41\u0e1a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e08\u0e30\u0e19\u0e33\u0e44\u0e1b\u0e1b\u0e23\u0e30\u0e21\u0e27\u0e25\u0e1c\u0e25\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e48\u0e27\u0e19 \u0e46 \u0e43\u0e19\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e08\u0e30\u0e22\u0e01\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 \u0e01\u0e32\u0e23\u0e19\u0e33\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e1a\u0e1a Array \u0e08\u0e33\u0e19\u0e27\u0e19 15,000 \u0e41\u0e16\u0e27 \u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b where in \u0e43\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 MySQL <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e40\u0e02\u0e35\u0e22\u0e19 query \u0e15\u0e23\u0e07 \u0e46 \u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT `uid` FROM `stock` WHERE uid IN(0, 1, 2, 3, 4, 5, 6, 7, 8, 9.... +15,000 <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e01\u0e47\u0e08\u0e30\u0e40\u0e01\u0e34\u0e14 Warning \u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">Message: preg_match(): Compilation failed: regular expression is too large at offset 93928<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e27\u0e34\u0e18\u0e35\u0e41\u0e01\u0e49\u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e04\u0e37\u0e2d\u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e41\u0e1a\u0e48\u0e07 Array \u0e2b\u0e25\u0e31\u0e01\u0e40\u0e1b\u0e47\u0e19 Array 2 \u0e21\u0e34\u0e15\u0e34\u0e43\u0e08\u0e1b\u0e23\u0e34\u0e21\u0e32\u0e13\u0e40\u0e17\u0e48\u0e32 \u0e46 \u0e01\u0e31\u0e19 \u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 array_chunk \u0e41\u0e25\u0e30\u0e04\u0e48\u0e2d\u0e22 \u0e46 query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e25\u0e33\u0e14\u0e31\u0e1a \u0e42\u0e14\u0e22\u0e04\u0e31\u0e48\u0e19\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 MySQL OR \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e04\u0e34\u0e27\u0e23\u0e35\u0e48\u0e04\u0e37\u0e2d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT <code>uid<\/code> FROM <code>stock<\/code> WHERE ( <code>uid<\/code> IN(0, 1) OR <code>uid<\/code> IN(2, 3) OR <code>uid<\/code> IN(4, 5))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 code \u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e01\u0e32\u0e23\u0e08\u0e23\u0e34\u0e07\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a PHP MySQL<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">$uid_list = array(1,2,3,4,5,6,7,8,9,10);\n$uid_list = array_chunk($uid_list,2); \/\/ \u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 array_chunk \u0e41\u0e1a\u0e48\u0e07 array \u0e40\u0e1b\u0e47\u0e19 2 \u0e21\u0e34\u0e15\u0e34 \u0e41\u0e25\u0e30\u0e21\u0e34\u0e15\u0e34\u0e25\u0e30 2 \u0e41\u0e16\u0e27\n$query_string = '';\n$last_loop = count($uid_list); \/\/ \u0e2b\u0e32 loop \u0e23\u0e2d\u0e1a\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\n$start_loop = 0;\nforeach($uid_list as $uids)\n{\n     $start_loop++;\n     $uids = implode(',',$uids);\n     if($start_loop == $last_loop){ \/\/ loop \u0e23\u0e2d\u0e1a\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e21\u0e35 OR\n         $query_string .= ' uid IN('.$uids.')';\n     }else{\n         $query_string .= ' uid IN('.$uids.') OR';\n     }\n}\n$query = $this->db->query('SELECT uid FROM stock WHERE ('.$query_string.')');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e08\u0e32\u0e01\u0e42\u0e04\u0e4a\u0e14\u0e14\u0e49\u0e32\u0e19\u0e1a\u0e19 \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e25\u0e2d\u0e07 run \u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e01\u0e47\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e44\u0e21\u0e48\u0e1e\u0e1a Warning \u0e41\u0e25\u0e49\u0e27 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e41\u0e1a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e44\u0e21\u0e48\u0e43\u0e2b\u0e49\u0e21\u0e35\u0e02\u0e19\u0e32\u0e14 bytes \u0e43\u0e2b\u0e0d\u0e48\u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b \u0e01\u0e48\u0e2d\u0e19\u0e19\u0e33\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e17\u0e33\u0e07\u0e32\u0e19\u0e43\u0e19\u0e2a\u0e39\u0e15\u0e23 <strong>regular expression<\/strong> \u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e48\u0e32\u0e07 \u0e46 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e1b\u0e31\u0e0d\u0e2b\u0e32 regular expression is too large \u0e43\u0e19 PHP \u0e19\u0e31\u0e49\u0e19\u0e40\u0e01\u0e34\u0e14\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e2b\u0e25\u0e32\u0e22\u0e01\u0e23\u0e13\u0e35 \u0e41\u0e15\u0e48\u0e2a\u0e32\u0e40\u0e2b\u0e15\u0e38\u0e2b\u0e25\u0e31\u0e01\u0e02\u0e2d\u0e07 Warning \u0e19\u0e31\u0e49\u0e19 \u0e21\u0e32\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e21\u0e35\u0e1b\u0e23\u0e34\u0e21\u0e32\u0e13\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e21\u0e32\u0e01\u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e19\u0e33\u0e44\u0e1b\u0e1c\u0e48\u0e32\u0e19\u0e01\u0e23\u0e30\u0e1a\u0e27\u0e19\u0e01\u0e32\u0e23 regular expression \u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e48\u0e32\u0e07 \u0e46 \u0e40\u0e0a\u0e48\u0e19 \u0e01\u0e32\u0e23\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5909,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2326,2422,2421,2420],"class_list":["post-5902","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","tag-php","tag-php-warning","tag-regular-expression","tag-regular-expression-is-too-large"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/5902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/comments?post=5902"}],"version-history":[{"count":7,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/5902\/revisions"}],"predecessor-version":[{"id":5910,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/5902\/revisions\/5910"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/media\/5909"}],"wp:attachment":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/media?parent=5902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/categories?post=5902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/tags?post=5902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}