{"id":3457,"date":"2025-03-24T08:46:08","date_gmt":"2025-03-23T23:46:08","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=3457"},"modified":"2025-03-24T08:46:38","modified_gmt":"2025-03-23T23:46:38","slug":"php%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e5%ae%8c%e5%85%a8%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%bc%e3%82%ac%e3%82%a4%e3%83%89%ef%bc%9a%e5%9f%ba%e6%9c%ac%e3%81%8b%e3%82%89%e5%bf%9c%e7%94%a8%e3%81%be","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=3457","title":{"rendered":"PHP\u6b63\u898f\u8868\u73fe\u5b8c\u5168\u30de\u30b9\u30bf\u30fc\u30ac\u30a4\u30c9\uff1a\u57fa\u672c\u304b\u3089\u5fdc\u7528\u307e\u3067\u4f7f\u3044\u3053\u306a\u305915\u306e\u30c6\u30af\u30cb\u30c3\u30af"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">PHP\u6b63\u898f\u8868\u73fe\u3068\u306f\uff1f\u521d\u5fc3\u8005\u306b\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">\u6b63\u898f\u8868\u73fe\u306e\u57fa\u672c\u6982\u5ff5\u3068\u5b9f\u7528\u6027<\/a>      <\/li>      <li>        <a href=\"#i-2\">PHP\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u7279\u5fb4\u3068\u5f37\u307f<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-3\">\u306a\u305cWeb\u30a8\u30f3\u30b8\u30cb\u30a2\u306f\u6b63\u898f\u8868\u73fe\u3092\u7fd2\u5f97\u3059\u3079\u304d\u306a\u306e\u304b<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-4\">PHP\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u305f\u3081\u306e3\u3064\u306e\u6e96\u5099\u30b9\u30c6\u30c3\u30d7<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-5\">\u6b63\u898f\u8868\u73fe\u306e\u30c7\u30ea\u30df\u30bf\u9078\u3073\u3067\u5931\u6557\u3057\u306a\u3044\u30b3\u30c4<\/a>      <\/li>      <li>        <a href=\"#i-6\">\u30d1\u30bf\u30fc\u30f3\u4fee\u98fe\u5b50\u306e\u610f\u5473\u3068\u9069\u5207\u306a\u4f7f\u3044\u5206\u3051<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-7\">\u6b63\u898f\u8868\u73fe\u3092\u30c6\u30b9\u30c8\u3059\u308b\u305f\u3081\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u7d39\u4ecb<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-8\">PHP\u6b63\u898f\u8868\u73fe\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f35\u9078<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-9\">\u6587\u5b57\u30af\u30e9\u30b9\u3068\u30e1\u30bf\u6587\u5b57\u3067\u67d4\u8edf\u306a\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u5b9f\u73fe<\/a>      <\/li>      <li>        <a href=\"#i-10\">\u91cf\u6307\u5b9a\u5b50\u3092\u4f7f\u3063\u3066\u7e70\u308a\u8fd4\u3057\u30d1\u30bf\u30fc\u30f3\u3092\u52b9\u7387\u7684\u306b\u8a18\u8ff0<\/a>      <\/li>      <li>        <a href=\"#i-11\">\u5148\u8aad\u307f\u30fb\u5f8c\u8aad\u307f\u3067\u6761\u4ef6\u4ed8\u304d\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u5b9f\u88c5<\/a>      <\/li>      <li>        <a href=\"#i-12\">\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3067\u30d1\u30bf\u30fc\u30f3\u3092\u6574\u7406\u3057\u3066\u518d\u5229\u7528<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-13\">\u9078\u629e\u30fb\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\u3067\u8907\u6570\u306e\u53ef\u80fd\u6027\u306b\u5bfe\u5fdc<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-14\">PHP\u306e\u4e3b\u8981\u306a\u6b63\u898f\u8868\u73fe\u95a2\u6570\u3068\u305d\u306e\u4f7f\u3044\u5206\u3051<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-15\">preg_match\u95a2\u6570\u3067\u30d1\u30bf\u30fc\u30f3\u306e\u691c\u7d22\u3068\u62bd\u51fa\u3092\u884c\u3046<\/a>      <\/li>      <li>        <a href=\"#i-16\">preg_replace\u95a2\u6570\u3067\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u7f6e\u63db\u3092\u5b9f\u88c5<\/a>      <\/li>      <li>        <a href=\"#i-17\">preg_split\u95a2\u6570\u3067\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u6587\u5b57\u5217\u5206\u5272<\/a>      <\/li>      <li>        <a href=\"#i-18\">preg_grep\u95a2\u6570\u3067\u914d\u5217\u8981\u7d20\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-19\">\u95a2\u6570\u9078\u629e\u306e\u30d2\u30f3\u30c8\u3068\u6ce8\u610f\u70b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-20\">\u5b9f\u8df5\u3067\u5f79\u7acb\u3064PHP\u6b63\u898f\u8868\u73fe15\u306e\u30c6\u30af\u30cb\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-21\">E\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-22\">URL\u306e\u6709\u52b9\u6027\u30c1\u30a7\u30c3\u30af\u3068\u69cb\u6210\u8981\u7d20\u306e\u62bd\u51fa<\/a>      <\/li>      <li>        <a href=\"#i-23\">\u96fb\u8a71\u756a\u53f7\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u56fd\u969b\u5bfe\u5fdc\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-24\">\u30d1\u30b9\u30ef\u30fc\u30c9\u5f37\u5ea6\u3092\u691c\u8a3c\u3059\u308b\u8907\u5408\u6761\u4ef6\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-25\">\u65e5\u4ed8\u30fb\u6642\u523b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u67d4\u8edf\u306a\u691c\u8a3c\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-26\">HTML\u30bf\u30b0\u306e\u5b89\u5168\u306a\u62bd\u51fa\u3068\u7f6e\u63db\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li>        <a href=\"#i-27\">CSV\u30c7\u30fc\u30bf\u306e\u9ad8\u5ea6\u306a\u89e3\u6790\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-28\">\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u306b\u5bfe\u5fdc\u3057\u305f\u6b63\u898f\u8868\u73fe\u306e\u30b3\u30c4<\/a>      <\/li>      <li>        <a href=\"#i-29\">JSON\u6587\u5b57\u5217\u306e\u69cb\u9020\u7684\u691c\u8a3c\u3068\u8981\u7d20\u62bd\u51fa<\/a>      <\/li>      <li>        <a href=\"#i-30\">XML\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u51e6\u7406\u306e\u305f\u3081\u306e\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-31\">\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u89e3\u6790\u306e\u305f\u3081\u306e\u52b9\u7387\u7684\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-32\">\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u306e\u691c\u8a3c<\/a>      <\/li>      <li>        <a href=\"#i-33\">\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u756a\u53f7\u306e\u7a2e\u985e\u5224\u5225\u3068\u691c\u8a3c<\/a>      <\/li>      <li>        <a href=\"#i-34\">IP\u30a2\u30c9\u30ec\u30b9\uff08v4\/v6\uff09\u306e\u691c\u8a3c\u3068\u5909\u63db<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-35\">\u90f5\u4fbf\u756a\u53f7\u30fb\u4f4f\u6240\u30c7\u30fc\u30bf\u306e\u6b63\u898f\u5316\u51e6\u7406<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-36\">\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u8853<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-37\">\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u6291\u5236\u3059\u308b\u66f8\u304d\u65b9\u306e\u30b3\u30c4<\/a>      <\/li>      <li>        <a href=\"#i-40\">\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6d3b\u7528\u3057\u305f\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306e\u9ad8\u901f\u5316<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-44\">\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3092\u5206\u5272\u3057\u3066\u53ef\u8aad\u6027\u3068\u52b9\u7387\u3092\u5411\u4e0a<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-48\">\u6b63\u898f\u8868\u73fe\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u5bfe\u7b56<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-49\">\u6b63\u898f\u8868\u73feDoS\u653b\u6483\uff08ReDoS\uff09\u3092\u9632\u3050\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08<\/a>      <\/li>      <li>        <a href=\"#i-52\">\u6b63\u898f\u8868\u73feDoS\u653b\u6483\uff08ReDoS\uff09\u3092\u9632\u3050\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08<\/a>      <\/li>      <li>        <a href=\"#i-55\">\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u6b63\u898f\u8868\u73fe\u3067\u51e6\u7406\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-59\">\u5b89\u5168\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306e\u305f\u3081\u306ePHP\u306e\u8a2d\u5b9a<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-63\">PHP\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u6d3b\u7528\u4f8b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-64\">Laravel\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3067\u306e\u9ad8\u5ea6\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/a>      <\/li>      <li>        <a href=\"#i-69\">Symfony\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3068\u6b63\u898f\u8868\u73fe\u306e\u9023\u643a<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-74\">WordPress\u30d7\u30e9\u30b0\u30a4\u30f3\u958b\u767a\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u5fdc\u7528<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-81\">\u3088\u304f\u3042\u308bPHP\u6b63\u898f\u8868\u73fe\u306e\u30c8\u30e9\u30d6\u30eb\u3068\u89e3\u6c7a\u6cd5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-82\">\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u30bb\u30c3\u30c8\u3067\u306e\u6b63\u898f\u8868\u73fe\u306e\u7f60\u3068\u5bfe\u7b56<\/a>      <\/li>      <li>        <a href=\"#i-85\">\u30c7\u30d0\u30c3\u30b0\u304c\u96e3\u3057\u3044\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-88\">\u74b0\u5883\u9593\u306e\u4e92\u63db\u6027\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308bPCRE\u8a2d\u5b9a\u306e\u8abf\u6574\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-91\">PHP\u6b63\u898f\u8868\u73fe\u30b9\u30ad\u30eb\u3092\u6b21\u306e\u30ec\u30d9\u30eb\u306b\u4e0a\u3052\u308b\u305f\u3081\u306e\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-92\">\u63a8\u5968\u66f8\u7c4d\u3068\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9\u3067\u4f53\u7cfb\u7684\u306b\u5b66\u3076<\/a>      <\/li>      <li>        <a href=\"#i-96\">\u5b9f\u8df5\u7684\u306a\u30b9\u30ad\u30eb\u3092\u78e8\u304f\u305f\u3081\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8ab2\u984c\u96c6<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-100\">PHP\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u305f\u3081\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u60c5\u5831\u4ea4\u63db\u306e\u5834<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">PHP\u6b63\u898f\u8868\u73fe\u3068\u306f\uff1f\u521d\u5fc3\u8005\u306b\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\uff08Regular Expression\uff09\u306f\u3001\u6587\u5b57\u5217\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u8a18\u8ff0\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306a\u8868\u8a18\u6cd5\u3067\u3059\u3002PHP\u3067Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u3001\u5165\u529b\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u3084\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u306b\u304a\u3044\u3066\u975e\u5e38\u306b\u91cd\u8981\u306a\u30b9\u30ad\u30eb\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001PHP\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u3092\u6bb5\u968e\u7684\u306b\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">\u6b63\u898f\u8868\u73fe\u306e\u57fa\u672c\u6982\u5ff5\u3068\u5b9f\u7528\u6027<\/h3>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u3068\u306f\u3001\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217\u3092\u691c\u7d22\u30fb\u7f6e\u63db\u30fb\u62bd\u51fa\u3059\u308b\u305f\u3081\u306e\u7279\u6b8a\u306a\u8a18\u6cd5\u306e\u3053\u3068\u3067\u3059\u3002\u4e00\u898b\u3059\u308b\u3068\u8907\u96d1\u3067\u8aad\u307f\u3065\u3089\u3044\u30b3\u30fc\u30c9\u306b\u898b\u3048\u307e\u3059\u304c\u3001\u7fd2\u5f97\u3059\u308c\u3070\u591a\u304f\u306e\u6587\u5b57\u5217\u51e6\u7406\u30bf\u30b9\u30af\u3092\u52b9\u7387\u5316\u3067\u304d\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u4f8b\uff1a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\n$pattern = '\/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$\/';\n$email = 'user@example.com';\nif (preg_match($pattern, $email)) {\n    echo \"\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306e\u5b9f\u7528\u6027\u306f\u4ee5\u4e0b\u306e\u70b9\u306b\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30c7\u30fc\u30bf\u691c\u8a3c<\/strong>\uff1a\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u304c\u7279\u5b9a\u306e\u5f62\u5f0f\uff08\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001\u96fb\u8a71\u756a\u53f7\u306a\u3069\uff09\u306b\u9069\u5408\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/li>\n\n\n\n<li><strong>\u30c6\u30ad\u30b9\u30c8\u89e3\u6790<\/strong>\uff1a\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3084HTML\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304b\u3089\u7279\u5b9a\u306e\u60c5\u5831\u3092\u62bd\u51fa<\/li>\n\n\n\n<li><strong>\u6587\u5b57\u5217\u7f6e\u63db<\/strong>\uff1a\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u57fa\u3065\u3044\u3066\u6587\u5b57\u5217\u3092\u5909\u63db<\/li>\n\n\n\n<li><strong>\u6587\u5b57\u5217\u5206\u5272<\/strong>\uff1a\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u6587\u5b57\u5217\u3092\u533a\u5207\u308a\u3001\u914d\u5217\u306b\u5909\u63db<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u64cd\u4f5c\u306f\u901a\u5e38\u306estring\u95a2\u6570\u3067\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u3053\u3068\u3067\u8907\u96d1\u306a\u6761\u4ef6\u3092\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">PHP\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u7279\u5fb4\u3068\u5f37\u307f<\/h3>\n\n\n\n<p>PHP\u306e\u6b63\u898f\u8868\u73fe\u306f\u3001**Perl\u4e92\u63db\u6b63\u898f\u8868\u73fe\uff08PCRE: Perl Compatible Regular Expressions\uff09**\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001PHP\u306f\u975e\u5e38\u306b\u5f37\u529b\u3067\u67d4\u8edf\u306a\u6b63\u898f\u8868\u73fe\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<div id=\"id-420d3950-aecd-4569-a43b-a8ac6c96dc77\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7279\u5fb4<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead><tbody><tr><td>\u8c4a\u5bcc\u306a\u30d1\u30bf\u30fc\u30f3\u8868\u73fe<\/td><td>\u6587\u5b57\u30af\u30e9\u30b9\u3001\u91cf\u6307\u5b9a\u5b50\u3001\u30a2\u30b5\u30fc\u30b7\u30e7\u30f3\u3001\u5f8c\u65b9\u53c2\u7167\u306a\u3069\u591a\u69d8\u306a\u8868\u73fe\u304c\u53ef\u80fd<\/td><\/tr><tr><td>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc<\/td><td>UTF-8\u306a\u3069\u306e\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c9\u306b\u5bfe\u5fdc\uff08u\u4fee\u98fe\u5b50\u5229\u7528\uff09<\/td><\/tr><tr><td>\u4fee\u98fe\u5b50\u306b\u3088\u308b\u62e1\u5f35<\/td><td>\u30d1\u30bf\u30fc\u30f3\u306e\u52d5\u4f5c\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u591a\u69d8\u306a\u4fee\u98fe\u5b50<\/td><\/tr><tr><td>\u9ad8\u3044\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/td><td>\u6700\u9069\u5316\u3055\u308c\u305fPCRE\u30a8\u30f3\u30b8\u30f3\u306b\u3088\u308b\u52b9\u7387\u7684\u306a\u51e6\u7406<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>PHP\u3067\u306f\u3001<code>preg_*<\/code>\u3067\u59cb\u307e\u308b\u95a2\u6570\u7fa4\u3092\u4f7f\u3063\u3066\u6b63\u898f\u8868\u73fe\u3092\u6271\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u30de\u30c3\u30c1\u30f3\u30b0\npreg_match('\/pattern\/', $subject, $matches);\n\n\/\/ \u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u5168\u3066\u306e\u7b87\u6240\u3092\u53d6\u5f97\npreg_match_all('\/pattern\/', $subject, $matches);\n\n\/\/ \u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217\u3092\u7f6e\u63db\npreg_replace('\/pattern\/', 'replacement', $subject);\n\n\/\/ \u30d1\u30bf\u30fc\u30f3\u3067\u6587\u5b57\u5217\u3092\u5206\u5272\npreg_split('\/pattern\/', $subject);\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-3\">\u306a\u305cWeb\u30a8\u30f3\u30b8\u30cb\u30a2\u306f\u6b63\u898f\u8868\u73fe\u3092\u7fd2\u5f97\u3059\u3079\u304d\u306a\u306e\u304b<\/h3>\n\n\n\n<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u304a\u3044\u3066\u3001\u6b63\u898f\u8868\u73fe\u30b9\u30ad\u30eb\u306f\u4ee5\u4e0b\u306e\u7406\u7531\u304b\u3089\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5165\u529b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u52b9\u7387\u5316<\/strong> \u591a\u304f\u306eWeb\u30d5\u30a9\u30fc\u30e0\u3067\u306f\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001\u96fb\u8a71\u756a\u53f7\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u5f37\u5ea6\u306a\u3069\u69d8\u3005\u306a\u5f62\u5f0f\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3053\u308c\u3089\u306e\u691c\u8a3c\u3092\u52b9\u7387\u7684\u306b\u884c\u3048\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306e\u5f37\u5316<\/strong> \u9069\u5207\u306a\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u60aa\u610f\u3042\u308b\u30c7\u30fc\u30bf\u306e\u691c\u51fa\u3084\u7121\u52b9\u5316\u304c\u53ef\u80fd\u306b\u306a\u308a\u3001XSS\u3084SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306a\u3069\u306e\u8106\u5f31\u6027\u5bfe\u7b56\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u7c21\u7d20\u5316<\/strong> \u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u304b\u3089\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u60c5\u5831\u3092\u62bd\u51fa\u3059\u308b\u969b\u3001\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3048\u3070\u6570\u884c\u306e\u30b3\u30fc\u30c9\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u91cf\u306e\u524a\u6e1b<\/strong> \u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u3092\u6b63\u898f\u8868\u73fe\u3067\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u591a\u304f\u306e\u6761\u4ef6\u5206\u5c90\u3084\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u524a\u6e1b\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u8a00\u8a9e\u9593\u306e\u77e5\u8b58\u79fb\u8ee2<\/strong> \u6b63\u898f\u8868\u73fe\u306e\u57fa\u672c\u7684\u306a\u8a18\u6cd5\u306f\u591a\u304f\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u5171\u901a\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u4e00\u5ea6\u7fd2\u5f97\u3059\u308c\u3070\u4ed6\u306e\u8a00\u8a9e\u3067\u3082\u5fdc\u7528\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u691c\u8a3c\u304b\u3089\u30c7\u30fc\u30bf\u89e3\u6790\u3001HTML\u30d1\u30fc\u30b9\u3001\u30ed\u30b0\u89e3\u6790\u307e\u3067\u5e45\u5e83\u3044\u5834\u9762\u3067\u6b63\u898f\u8868\u73fe\u304c\u6d3b\u8e8d\u3057\u307e\u3059\u3002PHP\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\uff08Laravel\u3001Symfony\u7b49\uff09\u3067\u3082\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3084\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u6b63\u898f\u8868\u73fe\u304c\u591a\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u6700\u521d\u306f\u5b66\u7fd2\u66f2\u7dda\u304c\u6025\u306a\u6280\u8853\u3067\u3059\u304c\u3001\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3092\u6bb5\u968e\u7684\u306b\u7406\u89e3\u3057\u3066\u3044\u3051\u3070\u3001\u8ab0\u3067\u3082\u30de\u30b9\u30bf\u30fc\u3067\u304d\u308b\u30b9\u30ad\u30eb\u3067\u3059\u3002\u4ee5\u964d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5177\u4f53\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af\u307e\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-4\">PHP\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u305f\u3081\u306e3\u3064\u306e\u6e96\u5099\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<p>PHP\u3067\u6b63\u898f\u8868\u73fe\u3092\u52b9\u679c\u7684\u306b\u4f7f\u3046\u306b\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u57fa\u672c\u7684\u306a\u6e96\u5099\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001PHP\u306e\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3044\u59cb\u3081\u308b\u524d\u306b\u77e5\u3063\u3066\u304a\u304f\u3079\u304d3\u3064\u306e\u91cd\u8981\u306a\u6e96\u5099\u30b9\u30c6\u30c3\u30d7\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">\u6b63\u898f\u8868\u73fe\u306e\u30c7\u30ea\u30df\u30bf\u9078\u3073\u3067\u5931\u6557\u3057\u306a\u3044\u30b3\u30c4<\/h3>\n\n\n\n<p>PHP\u306e\u6b63\u898f\u8868\u73fe\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u3092<strong>\u30c7\u30ea\u30df\u30bf<\/strong>\uff08\u533a\u5207\u308a\u6587\u5b57\uff09\u3067\u56f2\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30ea\u30df\u30bf\u306e\u9078\u629e\u306f\u4e00\u898b\u4e9b\u7d30\u306a\u3053\u3068\u306b\u601d\u3048\u307e\u3059\u304c\u3001\u30d1\u30bf\u30fc\u30f3\u306e\u53ef\u8aad\u6027\u3084\u4fdd\u5b88\u6027\u306b\u5927\u304d\u304f\u5f71\u97ff\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u4e3b\u306a\u30c7\u30ea\u30df\u30bf\u306e\u7a2e\u985e\uff1a<\/strong><\/p>\n\n\n<div id=\"id-51700d41-609b-4b89-98ff-74b8928c40d0\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30c7\u30ea\u30df\u30bf<\/th><th>\u4f8b<\/th><th>\u9069\u3057\u3066\u3044\u308b\u30b1\u30fc\u30b9<\/th><\/tr><\/thead><tbody><tr><td>\/<\/td><td><code>\/pattern\/<\/code><\/td><td>\u4e00\u822c\u7684\u306a\u6b63\u898f\u8868\u73fe\uff08\u6700\u3082\u4e00\u822c\u7684\uff09<\/td><\/tr><tr><td>#<\/td><td><code>#pattern#<\/code><\/td><td>\u30d1\u30b9\u3084URL\u304c\u542b\u307e\u308c\u308b\u30d1\u30bf\u30fc\u30f3<\/td><\/tr><tr><td>~<\/td><td><code>~pattern~<\/code><\/td><td>\u30b9\u30e9\u30c3\u30b7\u30e5\u304c\u591a\u7528\u3055\u308c\u308b\u30d1\u30bf\u30fc\u30f3<\/td><\/tr><tr><td>@<\/td><td><code>@pattern@<\/code><\/td><td>HTML\u30bf\u30b0\u306a\u3069\u3092\u6271\u3046\u30d1\u30bf\u30fc\u30f3<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u30c7\u30ea\u30df\u30bf\u9078\u3073\u306e\u30b3\u30c4\u306f\u3001<strong>\u30d1\u30bf\u30fc\u30f3\u5185\u3067\u983b\u7e41\u306b\u4f7f\u308f\u308c\u308b\u6587\u5b57\u3092\u30c7\u30ea\u30df\u30bf\u306b\u9078\u3070\u306a\u3044<\/strong>\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4e0d\u5fc5\u8981\u306a\u30a8\u30b9\u30b1\u30fc\u30d7\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u306e\u8ffd\u52a0\uff09\u3092\u6e1b\u3089\u3057\u3001\u53ef\u8aad\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff1a\u30d1\u30bf\u30fc\u30f3\u5185\u306e\u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u3059\u3079\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\nif (preg_match('\/https:\\\/\\\/example\\.com\\\/path\/', $url)) {\n    \/\/ \u51e6\u7406\n}\n\n\/\/ \u826f\u3044\u4f8b\uff1a\u30c7\u30ea\u30df\u30bf\u3092#\u306b\u5909\u66f4\u3057\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u3092\u6e1b\u3089\u3059\nif (preg_match('#https:\/\/example\\.com\/path#', $url)) {\n    \/\/ \u51e6\u7406\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">\u30d1\u30bf\u30fc\u30f3\u4fee\u98fe\u5b50\u306e\u610f\u5473\u3068\u9069\u5207\u306a\u4f7f\u3044\u5206\u3051<\/h3>\n\n\n\n<p>\u30c7\u30ea\u30df\u30bf\u306e\u5f8c\u306b<strong>\u4fee\u98fe\u5b50<\/strong>\uff08\u30d5\u30e9\u30b0\uff09\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u6b63\u898f\u8868\u73fe\u306e\u52d5\u4f5c\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002\u9069\u5207\u306a\u4fee\u98fe\u5b50\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3088\u308a\u67d4\u8edf\u3067\u30d1\u30ef\u30d5\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3088\u304f\u4f7f\u308f\u308c\u308b\u4fee\u98fe\u5b50\uff1a<\/strong><\/p>\n\n\n<div id=\"id-692a3073-d785-45cb-9eba-83ef5c33137d\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u4fee\u98fe\u5b50<\/th><th>\u610f\u5473<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>i<\/td><td>\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044<\/td><td><code>\/pattern\/i<\/code><\/td><\/tr><tr><td>m<\/td><td>\u8907\u6570\u884c\u30e2\u30fc\u30c9\uff08^$\u304c\u5404\u884c\u306b\u30de\u30c3\u30c1\uff09<\/td><td><code>\/^\u884c\u306e\u5148\u982d\/m<\/code><\/td><\/tr><tr><td>s<\/td><td>\u30c9\u30c3\u30c8\u304c\u6539\u884c\u306b\u3082\u30de\u30c3\u30c1<\/td><td><code>\/first.+last\/s<\/code><\/td><\/tr><tr><td>u<\/td><td>UTF-8\u30e2\u30fc\u30c9\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc\uff09<\/td><td><code>\/[\u3042-\u3093]\/u<\/code><\/td><\/tr><tr><td>x<\/td><td>\u62e1\u5f35\u30e2\u30fc\u30c9\uff08\u7a7a\u767d\u3068\u30b3\u30e1\u30f3\u30c8\u3092\u7121\u8996\uff09<\/td><td><code>\/pattern # \u30b3\u30e1\u30f3\u30c8\/x<\/code><\/td><\/tr><tr><td>g<\/td><td>\u30b0\u30ed\u30fc\u30d0\u30eb\u30de\u30c3\u30c1\uff08JavaScript\u7cfb\uff09<\/td><td>PHP\u3067\u306f\u4e0d\u8981(preg_match_all)<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u4fee\u98fe\u5b50\u306f\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u305b\u305a\u3001UTF-8\u5bfe\u5fdc\u3067\u3001\u8907\u6570\u884c\u30e2\u30fc\u30c9\n$pattern = '\/^\u540d\u524d:\\s*(.+)$\/imu';\npreg_match_all($pattern, $text, $matches);\n<\/pre>\n\n\n\n<p>\u7279\u306b\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u5834\u5408\u306f\u3001<strong>\u5fc5\u305a\u300cu\u300d\u4fee\u98fe\u5b50<\/strong>\u3092\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u306b\u3088\u308a\u6587\u5b57\u5316\u3051\u3084\u4e88\u671f\u305b\u306c\u52d5\u4f5c\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">\u6b63\u898f\u8868\u73fe\u3092\u30c6\u30b9\u30c8\u3059\u308b\u305f\u3081\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u7d39\u4ecb<\/h3>\n\n\n\n<p>\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3092\u66f8\u304f\u969b\u306f\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3092\u6d3b\u7528\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u6b21\u306e\u30c4\u30fc\u30eb\u306fPHP\u306e\u6b63\u898f\u8868\u73fe\u958b\u767a\u306b\u7279\u306b\u5f79\u7acb\u3061\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Regex101<\/strong> (https:\/\/regex101.com\/)\n<ul class=\"wp-block-list\">\n<li>PHP PCRE\u5c02\u7528\u30e2\u30fc\u30c9\u3042\u308a<\/li>\n\n\n\n<li>\u30d1\u30bf\u30fc\u30f3\u306e\u89e3\u8aac\u304c\u8a73\u7d30<\/li>\n\n\n\n<li>\u30de\u30c3\u30c1\u30b0\u30eb\u30fc\u30d7\u306e\u8996\u899a\u7684\u8868\u793a<\/li>\n\n\n\n<li>\u30d1\u30bf\u30fc\u30f3\u306e\u5171\u6709\u6a5f\u80fd<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>PHPLiveRegex<\/strong> (https:\/\/www.phpliveregex.com\/)\n<ul class=\"wp-block-list\">\n<li>PHP\u5c02\u7528\u306e\u30c6\u30b9\u30c8\u74b0\u5883<\/li>\n\n\n\n<li>preg_match\u3001preg_replace\u7b49\u306e\u95a2\u6570\u30c6\u30b9\u30c8<\/li>\n\n\n\n<li>\u7f6e\u63db\u7d50\u679c\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u8868\u793a<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>RegExr<\/strong> (https:\/\/regexr.com\/)\n<ul class=\"wp-block-list\">\n<li>\u76f4\u611f\u7684\u306a\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<\/li>\n\n\n\n<li>\u53c2\u7167\u7528\u306e\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u5185\u8535<\/li>\n\n\n\n<li>\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30d1\u30bf\u30fc\u30f3\u306e\u5171\u6709<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u672c\u756a\u74b0\u5883\u306b\u5b9f\u88c5\u3059\u308b\u524d\u306b\u6b63\u898f\u8868\u73fe\u306e\u52d5\u4f5c\u3092\u691c\u8a3c\u3067\u304d\u3001\u8a66\u884c\u932f\u8aa4\u306e\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u521d\u5fc3\u8005\u306e\u65b9\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u5404\u90e8\u5206\u304c\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u304b\u3092\u8996\u899a\u7684\u306b\u7406\u89e3\u3059\u308b\u305f\u3081\u306b\u975e\u5e38\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u4f5c\u6210\u3057\u305f\u6b63\u898f\u8868\u73fe\u3092\u30c6\u30b9\u30c8\u3059\u308b\u5178\u578b\u7684\u306a\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\n\/\/ 1. \u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3067\u30d1\u30bf\u30fc\u30f3\u3092\u30c6\u30b9\u30c8\n\/\/ 2. \u69d8\u3005\u306a\u5165\u529b\u3067\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9\u3092\u78ba\u8a8d\n\/\/ 3. \u554f\u984c\u306a\u3051\u308c\u3070PHP\u30b3\u30fc\u30c9\u306b\u7d71\u5408\n$pattern = '\/^[0-9]{3}-[0-9]{4}$\/'; \/\/ \u90f5\u4fbf\u756a\u53f7\u30d1\u30bf\u30fc\u30f3\n$test_strings = ['123-4567', '1234-567', 'abc-defg'];\nforeach ($test_strings as $test) {\n    echo \"$test: \" . (preg_match($pattern, $test) ? '\u6709\u52b9' : '\u7121\u52b9') . \"\\n\";\n}\n<\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u306e3\u3064\u306e\u6e96\u5099\u30b9\u30c6\u30c3\u30d7\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001PHP\u3067\u306e\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u7528\u3092\u30b9\u30e0\u30fc\u30ba\u306b\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u9069\u5207\u306a\u30c7\u30ea\u30df\u30bf\u306e\u9078\u629e\u3001\u5fc5\u8981\u306a\u4fee\u98fe\u5b50\u306e\u7406\u89e3\u3001\u305d\u3057\u3066\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3092\u6d3b\u7528\u3057\u305f\u30c6\u30b9\u30c8\u306f\u3001\u52b9\u679c\u7684\u306a\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u57fa\u790e\u3068\u306a\u308a\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001PHP\u6b63\u898f\u8868\u73fe\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-8\">PHP\u6b63\u898f\u8868\u73fe\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f35\u9078<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306e\u5a01\u529b\u3092\u5341\u5206\u306b\u5f15\u304d\u51fa\u3059\u306b\u306f\u3001\u57fa\u672c\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u8981\u7d20\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001PHP\u3067\u983b\u7e41\u306b\u4f7f\u308f\u308c\u308b5\u3064\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308c\u3070\u3001\u307b\u3068\u3093\u3069\u306e\u6587\u5b57\u5217\u51e6\u7406\u30bf\u30b9\u30af\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">\u6587\u5b57\u30af\u30e9\u30b9\u3068\u30e1\u30bf\u6587\u5b57\u3067\u67d4\u8edf\u306a\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u5b9f\u73fe<\/h3>\n\n\n\n<p><strong>\u6587\u5b57\u30af\u30e9\u30b9<\/strong>\u306f\u89d2\u62ec\u5f27 <code>[ ]<\/code> \u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u306e\u30bb\u30c3\u30c8\u3067\u3001\u305d\u306e\u4e2d\u306e\u4efb\u610f\u306e1\u6587\u5b57\u306b\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u8907\u6570\u306e\u6587\u5b57\u9078\u629e\u80a2\u3092\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div id=\"id-f6b20714-ea2a-43f5-a053-48fe802e7c0e\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6587\u5b57\u30af\u30e9\u30b9<\/th><th>\u8aac\u660e<\/th><th>\u30de\u30c3\u30c1\u3059\u308b\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>[abc]<\/code><\/td><td>a\u3001b\u3001c\u306e\u3044\u305a\u308c\u304b<\/td><td>a, b, c<\/td><\/tr><tr><td><code>[a-z]<\/code><\/td><td>\u5c0f\u6587\u5b57\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8<\/td><td>a, b, \u2026, z<\/td><\/tr><tr><td><code>[0-9]<\/code><\/td><td>\u6570\u5b57<\/td><td>0, 1, \u2026, 9<\/td><\/tr><tr><td><code>[^aeiou]<\/code><\/td><td>\u6307\u5b9a\u6587\u5b57\u4ee5\u5916\uff08\u5426\u5b9a\uff09<\/td><td>b, c, d, f, \u2026<\/td><\/tr><tr><td><code>[a-zA-Z0-9]<\/code><\/td><td>\u82f1\u6570\u5b57<\/td><td>a, B, 7, \u2026<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>\u30e1\u30bf\u6587\u5b57<\/strong>\u306f\u7279\u6b8a\u306a\u610f\u5473\u3092\u6301\u3064\u6587\u5b57\u3067\u3001\u3088\u304f\u4f7f\u308f\u308c\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div id=\"id-408c7ced-f96b-454e-aa4c-f719f4b42486\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30e1\u30bf\u6587\u5b57<\/th><th>\u8aac\u660e<\/th><th>\u540c\u7b49\u306e\u6587\u5b57\u30af\u30e9\u30b9<\/th><\/tr><\/thead><tbody><tr><td><code>\\d<\/code><\/td><td>\u6570\u5b57<\/td><td><code>[0-9]<\/code><\/td><\/tr><tr><td><code>\\w<\/code><\/td><td>\u5358\u8a9e\u69cb\u6210\u6587\u5b57<\/td><td><code>[a-zA-Z0-9_]<\/code><\/td><\/tr><tr><td><code>\\s<\/code><\/td><td>\u7a7a\u767d\u6587\u5b57<\/td><td><code>[ \\t\\n\\r\\f\\v]<\/code><\/td><\/tr><tr><td><code>.<\/code><\/td><td>\u4efb\u610f\u306e1\u6587\u5b57\uff08\u6539\u884c\u9664\u304f\uff09<\/td><td>\u2013<\/td><\/tr><tr><td><code>\\D<\/code><\/td><td>\u6570\u5b57\u4ee5\u5916<\/td><td><code>[^0-9]<\/code><\/td><\/tr><tr><td><code>\\W<\/code><\/td><td>\u5358\u8a9e\u69cb\u6210\u6587\u5b57\u4ee5\u5916<\/td><td><code>[^a-zA-Z0-9_]<\/code><\/td><\/tr><tr><td><code>\\S<\/code><\/td><td>\u7a7a\u767d\u6587\u5b57\u4ee5\u5916<\/td><td><code>[^ \\t\\n\\r\\f\\v]<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u96fb\u8a71\u756a\u53f7\u306e\u691c\u8a3c\uff08\u5e02\u5916\u5c40\u756a-\u5e02\u5185\u5c40\u756a-\u52a0\u5165\u8005\u756a\u53f7\uff09\n$pattern = '\/\\d{2,4}-\\d{2,4}-\\d{4}\/';\n$phone = '03-1234-5678';\nif (preg_match($pattern, $phone)) {\n    echo \"\u6709\u52b9\u306a\u96fb\u8a71\u756a\u53f7\u5f62\u5f0f\u3067\u3059\";\n}\n\n\/\/ \u82f1\u6570\u5b57\u3068\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u306e\u307f\u8a31\u53ef\u3059\u308b\u691c\u8a3c\n$pattern = '\/^[\\w]+$\/';  \/\/ \u307e\u305f\u306f '\/^\\w+$\/'\n$username = 'user_123';\nif (preg_match($pattern, $username)) {\n    echo \"\u6709\u52b9\u306a\u30e6\u30fc\u30b6\u30fc\u540d\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">\u91cf\u6307\u5b9a\u5b50\u3092\u4f7f\u3063\u3066\u7e70\u308a\u8fd4\u3057\u30d1\u30bf\u30fc\u30f3\u3092\u52b9\u7387\u7684\u306b\u8a18\u8ff0<\/h3>\n\n\n\n<p><strong>\u91cf\u6307\u5b9a\u5b50<\/strong>\u306f\u76f4\u524d\u306e\u8981\u7d20\u304c\u4f55\u56de\u7e70\u308a\u8fd4\u3055\u308c\u308b\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30d1\u30bf\u30fc\u30f3\u3092\u3088\u308a\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div id=\"id-6ca7736c-0c83-4485-a045-280ed646f09c\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u91cf\u6307\u5b9a\u5b50<\/th><th>\u8aac\u660e<\/th><th>\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>*<\/code><\/td><td>0\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><td><code>a*<\/code> \u306f \u201c\u201d, \u201ca\u201d, \u201caa\u201d, \u2026 \u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td><code>+<\/code><\/td><td>1\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><td><code>a+<\/code> \u306f \u201ca\u201d, \u201caa\u201d, \u2026 \u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td><code>?<\/code><\/td><td>0\u56de\u307e\u305f\u306f1\u56de\uff08\u4efb\u610f\uff09<\/td><td><code>a?<\/code> \u306f \u201c\u201d \u307e\u305f\u306f \u201ca\u201d \u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td><code>{n}<\/code><\/td><td>\u3061\u3087\u3046\u3069n\u56de<\/td><td><code>a{3}<\/code> \u306f \u201caaa\u201d \u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td><code>{n,}<\/code><\/td><td>n\u56de\u4ee5\u4e0a<\/td><td><code>a{2,}<\/code> \u306f \u201caa\u201d, \u201caaa\u201d, \u2026 \u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td><code>{n,m}<\/code><\/td><td>n\u56de\u4ee5\u4e0am\u56de\u4ee5\u4e0b<\/td><td><code>a{2,4}<\/code> \u306f \u201caa\u201d, \u201caaa\u201d, \u201caaaa\u201d \u306b\u30de\u30c3\u30c1<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u91cf\u6307\u5b9a\u5b50\u306b\u306f<strong>\u8caa\u6b32(greedy)<\/strong> \u3068 <strong>\u975e\u8caa\u6b32(lazy)<\/strong> \u306e2\u3064\u306e\u30e2\u30fc\u30c9\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8caa\u6b32<\/strong>\uff1a\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u3002\u53ef\u80fd\u306a\u9650\u308a\u9577\u3044\u30de\u30c3\u30c1\u3092\u8a66\u307f\u308b<\/li>\n\n\n\n<li><strong>\u975e\u8caa\u6b32<\/strong>\uff1a\u91cf\u6307\u5b9a\u5b50\u306e\u5f8c\u306b <code>?<\/code> \u3092\u4ed8\u3051\u308b\u3002\u53ef\u80fd\u306a\u9650\u308a\u77ed\u3044\u30de\u30c3\u30c1\u3092\u8a66\u307f\u308b<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ HTML\u30bf\u30b0\u306e\u62bd\u51fa\n$html = '&lt;div&gt;Content&lt;\/div&gt;&lt;p&gt;Paragraph&lt;\/p&gt;';\n\n\/\/ \u8caa\u6b32\u30de\u30c3\u30c1\u30f3\u30b0\uff08\u6700\u9577\u30de\u30c3\u30c1\uff09\npreg_match_all('\/&lt;.+&gt;\/', $html, $matches);\n\/\/ $matches[0] = ['&lt;div&gt;Content&lt;\/div&gt;&lt;p&gt;Paragraph&lt;\/p&gt;']\n\n\/\/ \u975e\u8caa\u6b32\u30de\u30c3\u30c1\u30f3\u30b0\uff08\u6700\u77ed\u30de\u30c3\u30c1\uff09\npreg_match_all('\/&lt;.+?&gt;\/', $html, $matches);\n\/\/ $matches[0] = ['&lt;div&gt;', '&lt;\/div&gt;', '&lt;p&gt;', '&lt;\/p&gt;']\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">\u5148\u8aad\u307f\u30fb\u5f8c\u8aad\u307f\u3067\u6761\u4ef6\u4ed8\u304d\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u5b9f\u88c5<\/h3>\n\n\n\n<p><strong>\u5148\u8aad\u307f<\/strong>\u3068<strong>\u5f8c\u8aad\u307f<\/strong>\uff08\u5408\u308f\u305b\u3066<strong>\u30bc\u30ed\u5e45\u30a2\u30b5\u30fc\u30b7\u30e7\u30f3<\/strong>\u3068\u547c\u3070\u308c\u308b\uff09\u306f\u3001\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u524d\u5f8c\u306b\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u6761\u4ef6\u3068\u3057\u307e\u3059\u304c\u3001\u30de\u30c3\u30c1\u7d50\u679c\u306b\u306f\u542b\u307e\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n<div id=\"id-6da9efc4-9aed-4e0d-b451-006dfeadaf80\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30a2\u30b5\u30fc\u30b7\u30e7\u30f3<\/th><th>\u8a18\u6cd5<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead><tbody><tr><td>\u80af\u5b9a\u5148\u8aad\u307f<\/td><td><code>(?=pattern)<\/code><\/td><td>pattern\u304c\u7d9a\u304f\u4f4d\u7f6e\u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td>\u5426\u5b9a\u5148\u8aad\u307f<\/td><td><code>(?!pattern)<\/code><\/td><td>pattern\u304c\u7d9a\u304b\u306a\u3044\u4f4d\u7f6e\u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td>\u80af\u5b9a\u5f8c\u8aad\u307f<\/td><td><code>(?&lt;=pattern)<\/code><\/td><td>pattern\u304c\u5148\u884c\u3059\u308b\u4f4d\u7f6e\u306b\u30de\u30c3\u30c1<\/td><\/tr><tr><td>\u5426\u5b9a\u5f8c\u8aad\u307f<\/td><td><code>(?&lt;!pattern)<\/code><\/td><td>pattern\u304c\u5148\u884c\u3057\u306a\u3044\u4f4d\u7f6e\u306b\u30de\u30c3\u30c1<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u3053\u308c\u3089\u306f\u7279\u306b\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u6587\u5b57\u5217\u306e\u691c\u51fa\u3084\u62bd\u51fa\u306b\u975e\u5e38\u306b\u5f79\u7acb\u3061\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u5f37\u5ea6\u691c\u8a3c\uff08\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u30fb\u6570\u5b57\u3092\u542b\u30808\u6587\u5b57\u4ee5\u4e0a\uff09\n$password = 'Password123';\n$pattern = '\/^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d).{8,}$\/';\nif (preg_match($pattern, $password)) {\n    echo \"\u5f37\u529b\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\";\n}\n\n\/\/ \u91d1\u984d\u306e\u62bd\u51fa\uff08\u901a\u8ca8\u8a18\u53f7\u306f\u542b\u3081\u306a\u3044\uff09\n$text = '\u5546\u54c1A: \u00a51,200 \u5546\u54c1B: \u00a53,500';\npreg_match_all('\/(?&lt;=\u00a5)[0-9,]+\/', $text, $matches);\n\/\/ $matches[0] = ['1,200', '3,500']\n\n\/\/ \u5358\u8a9e\u5883\u754c\u306b\u3042\u308b\u7279\u5b9a\u306e\u5358\u8a9e\u3092\u62bd\u51fa\n$text = 'PHP\u306fWeb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002php.net\u3067\u8a73\u7d30\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002';\npreg_match_all('\/\\bPHP\\b\/i', $text, $matches);\n\/\/ $matches[0] = ['PHP', 'php']\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3067\u30d1\u30bf\u30fc\u30f3\u3092\u6574\u7406\u3057\u3066\u518d\u5229\u7528<\/h3>\n\n\n\n<p><strong>\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/strong>\u306f\u62ec\u5f27 <code>( )<\/code> \u3067\u56f2\u307e\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3067\u3001\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092\u5225\u9014\u53d6\u5f97\u3057\u305f\u308a\u3001\u30d1\u30bf\u30fc\u30f3\u5185\u3067\u518d\u5229\u7528\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div id=\"id-60b9e655-5f4c-4fa2-a692-6724a65f4aca\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b0\u30eb\u30fc\u30d7\u69cb\u6587<\/th><th>\u8aac\u660e<\/th><th>\u7528\u9014<\/th><\/tr><\/thead><tbody><tr><td><code>(pattern)<\/code><\/td><td>\u57fa\u672c\u7684\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/td><td>\u30d1\u30bf\u30fc\u30f3\u306e\u4e00\u90e8\u3092\u53d6\u5f97<\/td><\/tr><tr><td><code>(?&lt;name&gt;pattern)<\/code><\/td><td>\u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/td><td>\u540d\u524d\u3067\u53c2\u7167\u53ef\u80fd<\/td><\/tr><tr><td><code>(?:pattern)<\/code><\/td><td>\u975e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/td><td>\u30b0\u30eb\u30fc\u30d7\u5316\u306e\u307f\uff08\u30ad\u30e3\u30d7\u30c1\u30e3\u3057\u306a\u3044\uff09<\/td><\/tr><tr><td><code>\\1<\/code>, <code>\\2<\/code>, \u2026<\/td><td>\u5f8c\u65b9\u53c2\u7167<\/td><td>\u4e00\u5ea6\u30de\u30c3\u30c1\u3057\u305f\u30d1\u30bf\u30fc\u30f3\u3092\u518d\u5229\u7528<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u4ed8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\uff08YYYY-MM-DD\uff09\u304b\u3089\u5404\u90e8\u5206\u3092\u62bd\u51fa\n$date = '2023-10-15';\npreg_match('\/([0-9]{4})-([0-9]{2})-([0-9]{2})\/', $date, $matches);\n\/\/ $matches = ['2023-10-15', '2023', '10', '15']\n\n\/\/ \u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\npreg_match('\/(?&lt;year&gt;[0-9]{4})-(?&lt;month&gt;[0-9]{2})-(?&lt;day&gt;[0-9]{2})\/', $date, $matches);\n\/\/ $matches = ['2023-10-15', 'year' =&gt; '2023', 'month' =&gt; '10', 'day' =&gt; '15', ...]\n\n\/\/ \u65e5\u4ed8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u63db\uff08YYYY-MM-DD \u2192 MM\/DD\/YYYY\uff09\n$result = preg_replace('\/([0-9]{4})-([0-9]{2})-([0-9]{2})\/', '$2\/$3\/$1', $date);\n\/\/ $result = '10\/15\/2023'\n\n\/\/ HTML\u30bf\u30b0\u3068\u305d\u306e\u5185\u5bb9\u3092\u5206\u3051\u3066\u53d6\u5f97\n$html = '&lt;h1&gt;Title&lt;\/h1&gt;&lt;p&gt;Paragraph&lt;\/p&gt;';\npreg_match_all('\/&lt;([a-z0-9]+)&gt;([^&lt;]+)&lt;\\\/\\1&gt;\/', $html, $matches, PREG_SET_ORDER);\n\/\/ $matches[0] = ['&lt;h1&gt;Title&lt;\/h1&gt;', 'h1', 'Title']\n\/\/ $matches[1] = ['&lt;p&gt;Paragraph&lt;\/p&gt;', 'p', 'Paragraph']\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-13\">\u9078\u629e\u30fb\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\u3067\u8907\u6570\u306e\u53ef\u80fd\u6027\u306b\u5bfe\u5fdc<\/h3>\n\n\n\n<p><strong>\u9078\u629e\u30d1\u30bf\u30fc\u30f3<\/strong>\uff08\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\uff09\u306f\u3001\u7e26\u7dda <code>|<\/code> \u3067\u533a\u5207\u3089\u308c\u305f\u8907\u6570\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u3044\u305a\u308c\u304b\u306b\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u62e1\u5f35\u5b50\u306e\u691c\u8a3c\n$filename = 'image.jpg';\n$pattern = '\/\\.(jpg|jpeg|png|gif)$\/i';\nif (preg_match($pattern, $filename)) {\n    echo \"\u6709\u52b9\u306a\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3067\u3059\";\n}\n\n\/\/ HTML\u306e\u898b\u51fa\u3057\u30bf\u30b0\u306b\u30de\u30c3\u30c1\n$html = '&lt;h1&gt;Title&lt;\/h1&gt;&lt;p&gt;Text&lt;\/p&gt;&lt;h2&gt;Subtitle&lt;\/h2&gt;';\npreg_match_all('\/&lt;(h[1-6])&gt;([^&lt;]+)&lt;\\\/\\1&gt;\/', $html, $matches, PREG_SET_ORDER);\n\/\/ $matches[0] = ['&lt;h1&gt;Title&lt;\/h1&gt;', 'h1', 'Title']\n\/\/ $matches[1] = ['&lt;h2&gt;Subtitle&lt;\/h2&gt;', 'h2', 'Subtitle']\n\n\/\/ \u6642\u9593\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\uff0824\u6642\u9593\u8868\u8a18\uff09\u306e\u691c\u8a3c\n$time = '23:45';\n$pattern = '\/^([01]?[0-9]|2[0-3]):[0-5][0-9]$\/';\nif (preg_match($pattern, $time)) {\n    echo \"\u6709\u52b9\u306a\u6642\u9593\u5f62\u5f0f\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<p>\u9078\u629e\u30d1\u30bf\u30fc\u30f3\u306f\u62ec\u5f27\u3067\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u4ed8\u306e\u7570\u306a\u308b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5bfe\u5fdc\n$pattern = '\/^(\\d{4}-\\d{2}-\\d{2})|(\\d{2}\\\/\\d{2}\\\/\\d{4})$\/';\n\/\/ '2023-10-15' \u307e\u305f\u306f '10\/15\/2023' \u306b\u30de\u30c3\u30c1\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e5\u3064\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001PHP\u306e\u6b63\u898f\u8868\u73fe\u306e\u8868\u73fe\u529b\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002\u6b63\u898f\u8868\u73fe\u306f\u4e00\u898b\u8907\u96d1\u306b\u898b\u3048\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306e\u57fa\u672c\u8981\u7d20\u3092\u7406\u89e3\u3059\u308c\u3070\u3001\u52b9\u7387\u7684\u3067\u67d4\u8edf\u306a\u6587\u5b57\u5217\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-14\">PHP\u306e\u4e3b\u8981\u306a\u6b63\u898f\u8868\u73fe\u95a2\u6570\u3068\u305d\u306e\u4f7f\u3044\u5206\u3051<\/h2>\n\n\n\n<p>PHP\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u3092\u6271\u3046\u305f\u3081\u306e\u69d8\u3005\u306a\u95a2\u6570\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u7528\u9014\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u52b9\u7387\u7684\u306a\u6587\u5b57\u5217\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u4e3b\u8981\u306a4\u3064\u306e\u95a2\u6570\u306b\u3064\u3044\u3066\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u5fdc\u7528\u4f8b\u307e\u3067\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-15\">preg_match\u95a2\u6570\u3067\u30d1\u30bf\u30fc\u30f3\u306e\u691c\u7d22\u3068\u62bd\u51fa\u3092\u884c\u3046<\/h3>\n\n\n\n<p><code>preg_match<\/code>\u95a2\u6570\u306f\u3001\u6587\u5b57\u5217\u5185\u3067\u30d1\u30bf\u30fc\u30f3\u3092<strong>1\u56de\u3060\u3051<\/strong>\u691c\u7d22\u3059\u308b\u95a2\u6570\u3067\u3059\u3002\u4e3b\u306b\u300c\u30d1\u30bf\u30fc\u30f3\u304c\u30de\u30c3\u30c1\u3059\u308b\u304b\u3069\u3046\u304b\u306e\u78ba\u8a8d\u300d\u3068\u300c\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u62bd\u51fa\u300d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\u69cb\u6587:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int preg_match(\n    string $pattern,      \/\/ \u691c\u7d22\u30d1\u30bf\u30fc\u30f3\n    string $subject,      \/\/ \u691c\u7d22\u5bfe\u8c61\u306e\u6587\u5b57\u5217\n    array &amp;$matches = null, \/\/ \u30de\u30c3\u30c1\u3057\u305f\u7d50\u679c\u3092\u683c\u7d0d\u3059\u308b\u914d\u5217\uff08\u7701\u7565\u53ef\uff09\n    int $flags = 0,       \/\/ \u52d5\u4f5c\u3092\u5236\u5fa1\u3059\u308b\u30d5\u30e9\u30b0\n    int $offset = 0       \/\/ \u691c\u7d22\u3092\u958b\u59cb\u3059\u308b\u4f4d\u7f6e\n)\n<\/pre>\n\n\n\n<p><strong>\u623b\u308a\u5024:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30de\u30c3\u30c1\u3057\u305f\u5834\u5408: <code>1<\/code><\/li>\n\n\n\n<li>\u30de\u30c3\u30c1\u3057\u306a\u304b\u3063\u305f\u5834\u5408: <code>0<\/code><\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u306e\u5834\u5408: <code>false<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5358\u7d14\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306e\u78ba\u8a8d\n$text = \"\u9023\u7d61\u5148: info@example.com\";\nif (preg_match('\/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\/', $text)) {\n    echo \"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\";\n}\n\n\/\/ \u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u62bd\u51fa\n$text = \"\u8a18\u4e8bID: A12345\";\npreg_match('\/ID: ([A-Z][0-9]{5})\/', $text, $matches);\n\/\/ $matches[0] \u306b\u306f \"ID: A12345\" \u304c\u3001$matches[1] \u306b\u306f \"A12345\" \u304c\u683c\u7d0d\u3055\u308c\u308b\necho \"\u62bd\u51fa\u3055\u308c\u305fID: \" . $matches[1];  \/\/ \"A12345\" \u3092\u51fa\u529b\n\n\/\/ \u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u306e\u4f7f\u7528\n$date = \"2023\u5e7410\u670815\u65e5\";\npreg_match('\/(?&lt;year&gt;[0-9]{4})\u5e74(?&lt;month&gt;[0-9]{1,2})\u6708(?&lt;day&gt;[0-9]{1,2})\u65e5\/', $date, $matches);\necho \"{$matches['year']}\u5e74{$matches['month']}\u6708{$matches['day']}\u65e5\"; \/\/ \"2023\u5e7410\u670815\u65e5\" \u3092\u51fa\u529b\n<\/pre>\n\n\n\n<p><code>preg_match<\/code>\u306f\u5358\u4e00\u306e\u30de\u30c3\u30c1\u306e\u307f\u3092\u691c\u7d22\u3059\u308b\u305f\u3081\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3084\u7279\u5b9a\u306e\u60c5\u5831\u306e\u62bd\u51fa\u306b\u6700\u9069\u3067\u3059\u3002\u8907\u6570\u306e\u30de\u30c3\u30c1\u3092\u691c\u7d22\u3057\u305f\u3044\u5834\u5408\u306f\u5f8c\u8ff0\u306e<code>preg_match_all<\/code>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-16\">preg_replace\u95a2\u6570\u3067\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u7f6e\u63db\u3092\u5b9f\u88c5<\/h3>\n\n\n\n<p><code>preg_replace<\/code>\u95a2\u6570\u306f\u3001\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3059\u308b\u90e8\u5206\u3092\u5225\u306e\u6587\u5b57\u5217\u306b\u7f6e\u304d\u63db\u3048\u308b\u95a2\u6570\u3067\u3059\u3002\u30b7\u30f3\u30d7\u30eb\u306a\u7f6e\u63db\u304b\u3089\u8907\u96d1\u306a\u6587\u5b57\u5217\u5909\u63db\u307e\u3067\u5e45\u5e83\u304f\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\u69cb\u6587:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mixed preg_replace(\n    mixed $pattern,       \/\/ \u691c\u7d22\u30d1\u30bf\u30fc\u30f3\uff08\u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\uff09\n    mixed $replacement,   \/\/ \u7f6e\u63db\u5f8c\u306e\u6587\u5b57\u5217\uff08\u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\uff09\n    mixed $subject,       \/\/ \u691c\u7d22\u5bfe\u8c61\u306e\u6587\u5b57\u5217\uff08\u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\uff09\n    int $limit = -1,      \/\/ \u7f6e\u63db\u56de\u6570\u306e\u4e0a\u9650\uff08-1\u306f\u7121\u5236\u9650\uff09\n    int &amp;$count = null    \/\/ \u5b9f\u884c\u3055\u308c\u305f\u7f6e\u63db\u306e\u56de\u6570\uff08\u7701\u7565\u53ef\uff09\n)\n<\/pre>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5358\u7d14\u306a\u7f6e\u63db\n$text = \"\u9023\u7d61\u5148: 090-1234-5678\";\n$result = preg_replace('\/(\\d{3})-(\\d{4})-(\\d{4})\/', '$1-****-$3', $text);\necho $result;  \/\/ \"\u9023\u7d61\u5148: 090-****-5678\" \u3092\u51fa\u529b\n\n\/\/ HTML\u30bf\u30b0\u306e\u9664\u53bb\n$html = \"&lt;p&gt;\u3053\u308c\u306f&lt;b&gt;\u30b5\u30f3\u30d7\u30eb&lt;\/b&gt;\u30c6\u30ad\u30b9\u30c8\u3067\u3059\u3002&lt;\/p&gt;\";\n$plain = preg_replace('\/&lt;[^&gt;]+&gt;\/', '', $html);\necho $plain;  \/\/ \"\u3053\u308c\u306f\u30b5\u30f3\u30d7\u30eb\u30c6\u30ad\u30b9\u30c8\u3067\u3059\u3002\" \u3092\u51fa\u529b\n\n\/\/ \u8907\u6570\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u540c\u6642\u306b\u7f6e\u63db\n$text = \"\u4eca\u65e5\u306e\u6c17\u6e29\u306f25\u5ea6\u3001\u6e7f\u5ea6\u306f60%\u3067\u3059\u3002\";\n$patterns = ['\/\u6c17\u6e29\u306f(\\d+)\u5ea6\/', '\/\u6e7f\u5ea6\u306f(\\d+)%\/'];\n$replacements = ['\u6c17\u6e29\u306f$1\u2103', '\u6e7f\u5ea6\u306f$1\uff05'];\n$result = preg_replace($patterns, $replacements, $text);\necho $result;  \/\/ \"\u4eca\u65e5\u306e\u6c17\u6e29\u306f25\u2103\u3001\u6e7f\u5ea6\u306f60\uff05\u3067\u3059\u3002\" \u3092\u51fa\u529b\n<\/pre>\n\n\n\n<p><strong>preg_replace_callback\u306b\u3088\u308b\u52d5\u7684\u7f6e\u63db:<\/strong><\/p>\n\n\n\n<p>\u3088\u308a\u8907\u96d1\u306a\u7f6e\u63db\u51e6\u7406\u306b\u306f<code>preg_replace_callback<\/code>\u304c\u4fbf\u5229\u3067\u3059\u3002\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092PHP\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3067\u51e6\u7406\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6570\u5024\u30922\u500d\u306b\u3059\u308b\n$text = \"\u5024A: 10, \u5024B: 20\";\n$result = preg_replace_callback(\n    '\/\\d+\/',\n    function($matches) {\n        return $matches[0] * 2;\n    },\n    $text\n);\necho $result;  \/\/ \"\u5024A: 20, \u5024B: 40\" \u3092\u51fa\u529b\n\n\/\/ \u65e5\u4ed8\u5f62\u5f0f\u3092\u5909\u63db\uff08YY\/MM\/DD \u2192 YYYY-MM-DD\uff09\n$text = \"\u958b\u59cb\u65e5: 23\/10\/15\";\n$result = preg_replace_callback(\n    '\/(\\d{2})\\\/(\\d{2})\\\/(\\d{2})\/',\n    function($matches) {\n        return \"20{$matches[1]}-{$matches[2]}-{$matches[3]}\";\n    },\n    $text\n);\necho $result;  \/\/ \"\u958b\u59cb\u65e5: 2023-10-15\" \u3092\u51fa\u529b\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">preg_split\u95a2\u6570\u3067\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u6587\u5b57\u5217\u5206\u5272<\/h3>\n\n\n\n<p><code>preg_split<\/code>\u95a2\u6570\u306f\u3001\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u533a\u5207\u308a\u6587\u5b57\u3068\u3057\u3066\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u307e\u3059\u3002\u5358\u7d14\u306a\u533a\u5207\u308a\u6587\u5b57\u3060\u3051\u3067\u306a\u304f\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u306e\u5206\u5272\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\u69cb\u6587:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">array preg_split(\n    string $pattern,  \/\/ \u533a\u5207\u308a\u30d1\u30bf\u30fc\u30f3\n    string $subject,  \/\/ \u5206\u5272\u5bfe\u8c61\u306e\u6587\u5b57\u5217\n    int $limit = -1,  \/\/ \u7d50\u679c\u306e\u6700\u5927\u8981\u7d20\u6570\uff08-1\u306f\u7121\u5236\u9650\uff09\n    int $flags = 0    \/\/ \u52d5\u4f5c\u3092\u5236\u5fa1\u3059\u308b\u30d5\u30e9\u30b0\n)\n<\/pre>\n\n\n\n<p><strong>\u4e3b\u306a\u30d5\u30e9\u30b0:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>PREG_SPLIT_NO_EMPTY<\/code>: \u7a7a\u306e\u8981\u7d20\u3092\u7d50\u679c\u304b\u3089\u9664\u5916<\/li>\n\n\n\n<li><code>PREG_SPLIT_DELIM_CAPTURE<\/code>: \u6b63\u898f\u8868\u73fe\u306e\u4e2d\u3067()\u3067\u56f2\u307e\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3082\u7d50\u679c\u306b\u542b\u3081\u308b<\/li>\n\n\n\n<li><code>PREG_SPLIT_OFFSET_CAPTURE<\/code>: \u5404\u8981\u7d20\u306e\u4f4d\u7f6e\u60c5\u5831\u3082\u53d6\u5f97<\/li>\n<\/ul>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7a7a\u767d\u6587\u5b57\u3067\u5206\u5272\uff08\u8907\u6570\u306e\u7a7a\u767d\u30821\u3064\u306e\u533a\u5207\u308a\u3068\u3057\u3066\u6271\u3046\uff09\n$text = \"PHP  JavaScript   Python\\tRuby\";\n$languages = preg_split('\/\\s+\/', $text);\n\/\/ $languages = [\"PHP\", \"JavaScript\", \"Python\", \"Ruby\"]\n\n\/\/ \u8907\u6570\u306e\u533a\u5207\u308a\u6587\u5b57\u3067\u5206\u5272\n$data = \"apple,orange;banana|grape\";\n$fruits = preg_split('\/[,;|]\/', $data);\n\/\/ $fruits = [\"apple\", \"orange\", \"banana\", \"grape\"]\n\n\/\/ \u7a7a\u306e\u8981\u7d20\u3092\u9664\u5916\n$csv = \"field1,,field3,field4,\";\n$fields = preg_split('\/,\/', $csv, -1, PREG_SPLIT_NO_EMPTY);\n\/\/ $fields = [\"field1\", \"field3\", \"field4\"]\n\n\/\/ HTML\u30bf\u30b0\u3068\u30c6\u30ad\u30b9\u30c8\u3092\u5206\u96e2\n$html = \"&lt;p&gt;\u6bb5\u843d1&lt;\/p&gt;&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c4&lt;\/div&gt;\";\n$parts = preg_split('\/(&lt;[^&gt;]+&gt;)\/', $html, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\/\/ $parts = [\"&lt;p&gt;\", \"\u6bb5\u843d1\", \"&lt;\/p&gt;\", \"&lt;div&gt;\", \"\u30b3\u30f3\u30c6\u30f3\u30c4\", \"&lt;\/div&gt;\"]\n<\/pre>\n\n\n\n<p><code>preg_split<\/code>\u306f\u3001\u8907\u96d1\u306a\u533a\u5207\u308a\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308b\u5834\u5408\u3084\u3001\u533a\u5207\u308a\u6587\u5b57\u81ea\u4f53\u3082\u7d50\u679c\u306b\u542b\u3081\u305f\u3044\u5834\u5408\u306b\u7279\u306b\u4fbf\u5229\u3067\u3059\u3002\u5358\u7d14\u306a\u533a\u5207\u308a\u6587\u5b57\u306a\u3089<code>explode()<\/code>\u95a2\u6570\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-18\">preg_grep\u95a2\u6570\u3067\u914d\u5217\u8981\u7d20\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/h3>\n\n\n\n<p><code>preg_grep<\/code>\u95a2\u6570\u306f\u3001\u914d\u5217\u306e\u8981\u7d20\u304b\u3089\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3059\u308b\u3082\u306e\u3060\u3051\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u8981\u7d20\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\u969b\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\u69cb\u6587:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">array preg_grep(\n    string $pattern,  \/\/ \u691c\u7d22\u30d1\u30bf\u30fc\u30f3\n    array $input,     \/\/ \u691c\u7d22\u5bfe\u8c61\u306e\u914d\u5217\n    int $flags = 0    \/\/ \u30d5\u30e9\u30b0\uff08PREG_GREP_INVERT\u306e\u307f\uff09\n)\n<\/pre>\n\n\n\n<p><strong>\u623b\u308a\u5024:<\/strong> \u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3057\u305f\u8981\u7d20\u3092\u542b\u3080\u914d\u5217\uff08\u5143\u306e\u914d\u5217\u306e\u30ad\u30fc\u306f\u4fdd\u6301\u3055\u308c\u307e\u3059\uff09<\/p>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6570\u5b57\u306e\u307f\u306e\u8981\u7d20\u3092\u62bd\u51fa\n$data = [\"abc\", \"123\", \"a1b2\", \"456\", \"def\"];\n$numbers = preg_grep('\/^\\d+$\/', $data);\n\/\/ $numbers = [1 =&gt; \"123\", 3 =&gt; \"456\"]\n\n\/\/ \u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u307f\u3092\u62bd\u51fa\n$files = [\"document.pdf\", \"image.jpg\", \"data.csv\", \"photo.png\"];\n$images = preg_grep('\/\\.(jpg|jpeg|png|gif)$\/i', $files);\n\/\/ $images = [1 =&gt; \"image.jpg\", 3 =&gt; \"photo.png\"]\n\n\/\/ \u30de\u30c3\u30c1\u3057\u306a\u3044\u8981\u7d20\u3092\u53d6\u5f97\uff08\u53cd\u8ee2\uff09\n$data = [\"apple\", \"banana\", \"cherry\", \"date\"];\n$not_starting_with_a = preg_grep('\/^a\/', $data, PREG_GREP_INVERT);\n\/\/ $not_starting_with_a = [1 =&gt; \"banana\", 2 =&gt; \"cherry\", 3 =&gt; \"date\"]\n<\/pre>\n\n\n\n<p><code>preg_grep<\/code>\u306f\u3001\u914d\u5217\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306b\u7279\u5316\u3057\u305f\u95a2\u6570\u3067\u3001\u901a\u5e38\u306e<code>array_filter()<\/code>\u95a2\u6570\u3068\u6b63\u898f\u8868\u73fe\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3088\u308a\u3082\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-19\">\u95a2\u6570\u9078\u629e\u306e\u30d2\u30f3\u30c8\u3068\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p>PHP\u306e\u6b63\u898f\u8868\u73fe\u95a2\u6570\u3092\u52b9\u679c\u7684\u306b\u4f7f\u3046\u305f\u3081\u306e\u30d2\u30f3\u30c8\u3092\u307e\u3068\u3081\u307e\u3059\uff1a<\/p>\n\n\n<div id=\"id-064e9788-433c-46ee-b216-593e4a395cb8\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u76ee\u7684<\/th><th>\u63a8\u5968\u3055\u308c\u308b\u95a2\u6570<\/th><th>\u4ee3\u66ff\u624b\u6bb5<\/th><\/tr><\/thead><tbody><tr><td>\u30d1\u30bf\u30fc\u30f3\u304c\u30de\u30c3\u30c1\u3059\u308b\u304b\u78ba\u8a8d<\/td><td><code>preg_match()<\/code><\/td><td><code>strpos()<\/code>\uff08\u5358\u7d14\u306a\u6587\u5b57\u5217\u691c\u7d22\u306e\u5834\u5408\uff09<\/td><\/tr><tr><td>\u3059\u3079\u3066\u306e\u30de\u30c3\u30c1\u3092\u62bd\u51fa<\/td><td><code>preg_match_all()<\/code><\/td><td>\u2013<\/td><\/tr><tr><td>\u30d1\u30bf\u30fc\u30f3\u306b\u57fa\u3065\u304f\u7f6e\u63db<\/td><td><code>preg_replace()<\/code><\/td><td><code>str_replace()<\/code>\uff08\u5358\u7d14\u306a\u7f6e\u63db\u306e\u5834\u5408\uff09<\/td><\/tr><tr><td>\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u5206\u5272<\/td><td><code>preg_split()<\/code><\/td><td><code>explode()<\/code>\uff08\u5358\u7d14\u306a\u533a\u5207\u308a\u306e\u5834\u5408\uff09<\/td><\/tr><tr><td>\u914d\u5217\u8981\u7d20\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/td><td><code>preg_grep()<\/code><\/td><td><code>array_filter()<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u6ce8\u610f\u70b9:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u3067\u3059\u304c\u3001\u5358\u7d14\u306a\u64cd\u4f5c\u306b\u306f\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u95a2\u6570\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3059<\/li>\n\n\n\n<li>\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u304c\u5897\u3048\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4f4e\u4e0b\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u51e6\u7406\u306b\u306f<code>preg_last_error()<\/code>\u3092\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046<\/li>\n\n\n\n<li>UTF-8\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u5834\u5408\u306f\u3001\u5fc5\u305a<code>u<\/code>\u4fee\u98fe\u5b50\u3092\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30a8\u30e9\u30fc\u51e6\u7406\u306e\u4f8b\n$result = preg_match($pattern, $subject);\nif ($result === false) {\n    $error_code = preg_last_error();\n    $error_message = [\n        PREG_NO_ERROR =&gt; \"\u30a8\u30e9\u30fc\u306a\u3057\",\n        PREG_INTERNAL_ERROR =&gt; \"\u5185\u90e8PCRE\u30a8\u30e9\u30fc\",\n        PREG_BACKTRACK_LIMIT_ERROR =&gt; \"\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u5236\u9650\u8d85\u904e\",\n        PREG_RECURSION_LIMIT_ERROR =&gt; \"\u518d\u5e30\u5236\u9650\u8d85\u904e\",\n        PREG_BAD_UTF8_ERROR =&gt; \"\u4e0d\u6b63\u306aUTF-8\u30c7\u30fc\u30bf\",\n        PREG_BAD_UTF8_OFFSET_ERROR =&gt; \"\u4e0d\u6b63\u306aUTF-8\u30aa\u30d5\u30bb\u30c3\u30c8\"\n    ];\n    echo \"\u6b63\u898f\u8868\u73fe\u30a8\u30e9\u30fc: \" . ($error_message[$error_code] ?? \"\u4e0d\u660e\u306a\u30a8\u30e9\u30fc\");\n}\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u9069\u5207\u306b\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001PHP\u3067\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u3088\u308a\u52b9\u7387\u7684\u304b\u3064\u67d4\u8edf\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-20\">\u5b9f\u8df5\u3067\u5f79\u7acb\u3064PHP\u6b63\u898f\u8868\u73fe15\u306e\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u5b9f\u969b\u306e\u958b\u767a\u73fe\u5834\u3067\u5f79\u7acb\u3064\u3001PHP\u6b63\u898f\u8868\u73fe\u306e\u5b9f\u8df5\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u309215\u500b\u7d39\u4ecb\u3057\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3068\u3068\u3082\u306b\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-21\">E\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\u306f\u6700\u3082\u983b\u7e41\u306b\u4f7f\u308f\u308c\u308b\u6b63\u898f\u8868\u73fe\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u691c\u8a3c\n$pattern = '\/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$\/';\n$email = 'user@example.com';\nif (preg_match($pattern, $email)) {\n    echo \"\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u5185\u8a33\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>^[a-zA-Z0-9._%+-]+<\/code> \u2013 \u30ed\u30fc\u30ab\u30eb\u90e8\uff08@\u306e\u524d\uff09\uff1a\u82f1\u6570\u5b57\u3068\u4e00\u90e8\u306e\u8a18\u53f7\u3092\u8a31\u53ef<\/li>\n\n\n\n<li><code>@<\/code> \u2013 @ \u8a18\u53f7<\/li>\n\n\n\n<li><code>[a-zA-Z0-9.-]+<\/code> \u2013 \u30c9\u30e1\u30a4\u30f3\u540d\uff1a\u82f1\u6570\u5b57\u3001\u30cf\u30a4\u30d5\u30f3\u3001\u30c9\u30c3\u30c8\u3092\u8a31\u53ef<\/li>\n\n\n\n<li><code>\\.[a-zA-Z]{2,}$<\/code> \u2013 \u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30c9\u30e1\u30a4\u30f3\uff1a\u30c9\u30c3\u30c8+2\u6587\u5b57\u4ee5\u4e0a\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8<\/li>\n<\/ul>\n\n\n\n<p>\u3088\u308a\u53b3\u5bc6\u306a\u691c\u8a3c\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001PHP\u306e <code>filter_var()<\/code> \u95a2\u6570\u3082\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n    echo \"\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-22\">URL\u306e\u6709\u52b9\u6027\u30c1\u30a7\u30c3\u30af\u3068\u69cb\u6210\u8981\u7d20\u306e\u62bd\u51fa<\/h3>\n\n\n\n<p>URL\u306e\u691c\u8a3c\u3068\u5404\u69cb\u6210\u8981\u7d20\u306e\u62bd\u51fa\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306aURL\u691c\u8a3c\n$pattern = '\/^(https?:\\\/\\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\\/\\w \\.-]*)*\\\/?$\/';\n$url = 'https:\/\/www.example.com\/path\/to\/page.html';\nif (preg_match($pattern, $url)) {\n    echo \"\u6709\u52b9\u306aURL\u3067\u3059\";\n}\n\n\/\/ URL\u69cb\u6210\u8981\u7d20\u306e\u62bd\u51fa\n$url_pattern = '\/^(?:(?P&lt;scheme&gt;https?|ftp):\\\/\\\/)?(?:(?P&lt;user&gt;[^:\\s]+)(?::(?P&lt;pass&gt;[^@\\s]+))?@)?(?P&lt;host&gt;[^:\\\/\\s]+)(?::(?P&lt;port&gt;\\d+))?(?P&lt;path&gt;\\\/[^\\s]*)?(?:\\?(?P&lt;query&gt;[^\\s]*))?(?:#(?P&lt;fragment&gt;[^\\s]*))?$\/i';\npreg_match($url_pattern, $url, $matches);\n\/*\n$matches['scheme'] = 'https'\n$matches['host'] = 'www.example.com'\n$matches['path'] = '\/path\/to\/page.html'\n*\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-23\">\u96fb\u8a71\u756a\u53f7\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u56fd\u969b\u5bfe\u5fdc\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/h3>\n\n\n\n<p>\u69d8\u3005\u306a\u5f62\u5f0f\u306e\u96fb\u8a71\u756a\u53f7\u3092\u691c\u8a3c\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u672c\u306e\u96fb\u8a71\u756a\u53f7\uff0803-1234-5678\u5f62\u5f0f\uff09\n$jp_pattern = '\/^0\\d{1,4}-\\d{1,4}-\\d{4}$\/';\n\n\/\/ \u56fd\u969b\u5bfe\u5fdc\uff08\u8907\u6570\u5f62\u5f0f\uff09\n$int_pattern = '\/^(?:\\+\\d{1,3}[-\\s]?)?(?:\\(\\d{1,4}\\)|\\d{1,4})[-\\s]?\\d{1,4}[-\\s]?\\d{1,9}$\/';\n\n\/\/ E.164\u5f62\u5f0f\uff08\u56fd\u969b\u6a19\u6e96\uff1a+819012345678\u306a\u3069\uff09\n$e164_pattern = '\/^\\+[1-9]\\d{1,14}$\/';\n\n$phone = '03-1234-5678';\nif (preg_match($jp_pattern, $phone)) {\n    echo \"\u6709\u52b9\u306a\u65e5\u672c\u306e\u96fb\u8a71\u756a\u53f7\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-24\">\u30d1\u30b9\u30ef\u30fc\u30c9\u5f37\u5ea6\u3092\u691c\u8a3c\u3059\u308b\u8907\u5408\u6761\u4ef6\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u5b89\u5168\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u30dd\u30ea\u30b7\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306e\u691c\u8a3c\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u5f37\u5ea6\u691c\u8a3c\uff088\u6587\u5b57\u4ee5\u4e0a\u3001\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u30fb\u6570\u5b57\u3092\u542b\u3080\uff09\n$pattern = '\/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,}$\/';\n\n\/\/ \u3088\u308a\u5f37\u56fa\uff08\u7279\u6b8a\u6587\u5b57\u3082\u5fc5\u9808\uff09\n$strong_pattern = '\/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&amp;])[A-Za-z\\d@$!%*?&amp;]{8,}$\/';\n\n$password = 'Passw0rd';\nif (preg_match($pattern, $password)) {\n    echo \"\u30d1\u30b9\u30ef\u30fc\u30c9\u5f37\u5ea6\u306f\u5341\u5206\u3067\u3059\";\n} else {\n    echo \"\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u306f\u5927\u6587\u5b57\u3001\u5c0f\u6587\u5b57\u3001\u6570\u5b57\u3092\u542b\u30808\u6587\u5b57\u4ee5\u4e0a\u304c\u5fc5\u8981\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306e <code>(?=.*[a-z])<\/code> \u306e\u3088\u3046\u306a\u69cb\u6587\u306f\u300c\u80af\u5b9a\u5148\u8aad\u307f\u300d\u3068\u547c\u3070\u308c\u3001\u300c\u3053\u306e\u4f4d\u7f6e\u306b\u7d9a\u304f\u6587\u5b57\u5217\u306e\u4e2d\u306b\u5c0f\u6587\u5b57\u304c\u5c11\u306a\u304f\u3068\u30821\u3064\u3042\u308b\u300d\u3068\u3044\u3046\u6761\u4ef6\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-25\">\u65e5\u4ed8\u30fb\u6642\u523b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u67d4\u8edf\u306a\u691c\u8a3c\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u69d8\u3005\u306a\u65e5\u4ed8\u5f62\u5f0f\u3092\u691c\u8a3c\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ ISO 8601\u65e5\u4ed8 (YYYY-MM-DD)\n$iso_date = '\/^\\d{4}-\\d{2}-\\d{2}$\/';\n\n\/\/ \u8907\u6570\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5bfe\u5fdc\n$date_pattern = '\/^\\d{4}[-\\\/](0?[1-9]|1[0-2])[-\\\/](0?[1-9]|[12][0-9]|3[01])$\/';\n\n\/\/ \u6642\u523b (24\u6642\u9593\u5f62\u5f0f)\n$time_pattern = '\/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$\/';\n\n$date = '2023-10-15';\nif (preg_match($iso_date, $date)) {\n    \/\/ \u5f62\u5f0f\u306f\u6b63\u3057\u3044\u304c\u3001\u5b9f\u969b\u306e\u65e5\u4ed8\u304c\u6709\u52b9\u304b\u3082\u78ba\u8a8d\u3059\u3079\u304d\n    $parts = explode('-', $date);\n    if (checkdate((int)$parts[1], (int)$parts[2], (int)$parts[0])) {\n        echo \"\u6709\u52b9\u306a\u65e5\u4ed8\u3067\u3059\";\n    }\n}\n<\/pre>\n\n\n\n<p>\u65e5\u4ed8\u5f62\u5f0f\u306e\u691c\u8a3c\u5f8c\u306f\u3001<code>checkdate()<\/code> \u95a2\u6570\u3092\u4f7f\u3063\u3066\u5b9f\u969b\u306e\u65e5\u4ed8\u304c\u5b58\u5728\u3059\u308b\u304b\u3092\u691c\u8a3c\u3059\u308b\u306e\u304c\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-26\">HTML\u30bf\u30b0\u306e\u5b89\u5168\u306a\u62bd\u51fa\u3068\u7f6e\u63db\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>HTML\u304b\u3089\u30bf\u30b0\u3092\u62bd\u51fa\u3057\u305f\u308a\u3001\u7f6e\u63db\u3057\u305f\u308a\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ HTML\u30bf\u30b0\u306e\u62bd\u51fa\n$html = '&lt;p&gt;\u3053\u308c\u306f&lt;a href=\"https:\/\/example.com\"&gt;\u30ea\u30f3\u30af&lt;\/a&gt;\u3068&lt;b&gt;\u592a\u5b57&lt;\/b&gt;\u3092\u542b\u3080\u30c6\u30ad\u30b9\u30c8\u3067\u3059&lt;\/p&gt;';\n$tag_pattern = '\/&lt;([a-z][a-z0-9]*)\\b[^&gt;]*&gt;(.*?)&lt;\\\/\\1&gt;\/is';\npreg_match_all($tag_pattern, $html, $matches);\n\/*\n$matches[0] - \u30de\u30c3\u30c1\u3057\u305f\u5b8c\u5168\u306a\u30bf\u30b0\u3068\u30b3\u30f3\u30c6\u30f3\u30c4\n$matches[1] - \u30bf\u30b0\u540d ('p', 'a', 'b')\n$matches[2] - \u30bf\u30b0\u5185\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\n*\/\n\n\/\/ \u30ea\u30f3\u30af\u306eURL\u3092\u62bd\u51fa\n$link_pattern = '\/&lt;a\\s+(?:[^&gt;]*?\\s+)?href=([\"\\'])(.*?)\\1\/i';\npreg_match_all($link_pattern, $html, $urls);\n\/\/ $urls[2] - \u62bd\u51fa\u3055\u308c\u305fURL\n\n\/\/ HTML\u30bf\u30b0\u3092\u5b89\u5168\u306b\u9664\u53bb\n$text = preg_replace('\/&lt;[^&gt;]+&gt;\/', '', $html);\n\/\/ \"\u3053\u308c\u306f\u30ea\u30f3\u30af\u3068\u592a\u5b57\u3092\u542b\u3080\u30c6\u30ad\u30b9\u30c8\u3067\u3059\"\n<\/pre>\n\n\n\n<p>HTML\u306e\u5b8c\u5168\u306a\u89e3\u6790\u306b\u306f\u5c02\u7528\u306e\u30d1\u30fc\u30b5\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-27\">CSV\u30c7\u30fc\u30bf\u306e\u9ad8\u5ea6\u306a\u89e3\u6790\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>CSV\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\u5b8c\u5168\u306aCSV\u89e3\u6790\u306b\u306fPHP\u306e <code>str_getcsv()<\/code> \u3084 <code>fgetcsv()<\/code> \u95a2\u6570\u304c\u3088\u308a\u9069\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u7279\u5b9a\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u62bd\u51fa\u306b\u306f\u6b63\u898f\u8868\u73fe\u3082\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5358\u7d14\u306aCSV\u30d5\u30a3\u30fc\u30eb\u30c9\u62bd\u51fa\n$csv_line = 'field1,\"field, with, commas\",field3';\n$pattern = '\/(?&lt;=^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)\/';\npreg_match_all($pattern, $csv_line, $fields);\n\/\/ $fields[0] - \u62bd\u51fa\u3055\u308c\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\n\n\/\/ \u3088\u308a\u5b9f\u7528\u7684\u306a\u306e\u306fPHP\u6a19\u6e96\u95a2\u6570\n$fields = str_getcsv($csv_line);\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-28\">\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u306b\u5bfe\u5fdc\u3057\u305f\u6b63\u898f\u8868\u73fe\u306e\u30b3\u30c4<\/h3>\n\n\n\n<p>\u65e5\u672c\u8a9e\u306a\u3069\u591a\u8a00\u8a9e\u30c6\u30ad\u30b9\u30c8\u3092\u6271\u3046\u5834\u5408\u306f\u3001\u5fc5\u305a <code>u<\/code> \u4fee\u98fe\u5b50\uff08UTF-8\u30e2\u30fc\u30c9\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u306e\u30d1\u30bf\u30fc\u30f3\n$text = \"\u3053\u308c\u306fPHP\u306b\u3088\u308b\u6b63\u898f\u8868\u73fe\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002\";\n\n\/\/ \u3072\u3089\u304c\u306a\u306e\u307f\u3092\u62bd\u51fa\n$hiragana = '\/[\u3041-\u3093\u30fc]+\/u';\npreg_match_all($hiragana, $text, $matches);\n\/\/ $matches[0] = [\"\u3053\u308c\u306f\", \"\u306b\u3088\u308b\", \"\u3072\u3087\u3046\u3052\u3093\", \"\u306e\", \"\u30b5\u30f3\u30d7\u30eb\", \"\u3067\u3059\"]\n\n\/\/ \u30ab\u30bf\u30ab\u30ca\u306e\u307f\u3092\u62bd\u51fa\n$katakana = '\/[\u30a1-\u30f6\u30fc]+\/u';\npreg_match_all($katakana, $text, $matches);\n\/\/ $matches[0] = [\"\u30b5\u30f3\u30d7\u30eb\"]\n\n\/\/ \u6f22\u5b57\u306e\u307f\u3092\u62bd\u51fa\n$kanji = '\/[\u4e00-\u9fa0]+\/u';\npreg_match_all($kanji, $text, $matches);\n\/\/ $matches[0] = [\"\u6b63\u898f\u8868\u73fe\"]\n<\/pre>\n\n\n\n<p>\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u3092\u6271\u3046\u969b\u306f\u5e38\u306b <code>u<\/code> \u4fee\u98fe\u5b50\u3092\u4ed8\u3051\u308b\u3053\u3068\u3067\u3001\u6587\u5b57\u5316\u3051\u3084\u4e88\u671f\u305b\u306c\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u9632\u304e\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-29\">JSON\u6587\u5b57\u5217\u306e\u69cb\u9020\u7684\u691c\u8a3c\u3068\u8981\u7d20\u62bd\u51fa<\/h3>\n\n\n\n<p>JSON\u6587\u5b57\u5217\u304b\u3089\u7279\u5b9a\u306e\u8981\u7d20\u3092\u62bd\u51fa\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u5b8c\u5168\u306aJSON\u89e3\u6790\u306b\u306f <code>json_decode()<\/code> \u95a2\u6570\u306e\u4f7f\u7528\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ JSON\u30ad\u30fc\u306e\u62bd\u51fa\n$json = '{\"name\": \"John\", \"age\": 30, \"city\": \"Tokyo\"}';\n$key_pattern = '\/\"([^\"]+)\"\\s*:\/';\npreg_match_all($key_pattern, $json, $keys);\n\/\/ $keys[1] = [\"name\", \"age\", \"city\"]\n\n\/\/ JSON\u306e\u57fa\u672c\u7684\u306a\u69cb\u9020\u691c\u8a3c\n$json_pattern = '\/^\\s*(\\{.*\\}|\\[.*\\])\\s*$\/s';\nif (preg_match($json_pattern, $json)) {\n    \/\/ \u57fa\u672c\u7684\u306a\u69cb\u9020\u306f\u6b63\u3057\u3044\u3088\u3046\u3067\u3059\u304c\u3001\u53b3\u5bc6\u306a\u691c\u8a3c\u306b\u306fjson_decode()\u3092\u4f7f\u7528\n    $obj = json_decode($json);\n    if (json_last_error() === JSON_ERROR_NONE) {\n        echo \"\u6709\u52b9\u306aJSON\u3067\u3059\";\n    }\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-30\">XML\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u51e6\u7406\u306e\u305f\u3081\u306e\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>XML\u51e6\u7406\u306b\u5f79\u7acb\u3064\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u304c\u3001\u672c\u683c\u7684\u306aXML\u89e3\u6790\u306b\u306f <code>SimpleXML<\/code> \u3084 <code>DOMDocument<\/code> \u306a\u3069\u306e\u5c02\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u3079\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ XML\u30bf\u30b0\u62bd\u51fa\n$xml = '&lt;book id=\"1\"&gt;&lt;title&gt;PHP\u5165\u9580&lt;\/title&gt;&lt;author&gt;\u5c71\u7530\u592a\u90ce&lt;\/author&gt;&lt;\/book&gt;';\n$tag_pattern = '\/&lt;([a-z][a-z0-9]*)\\b[^&gt;]*&gt;(.*?)&lt;\\\/\\1&gt;\/is';\npreg_match_all($tag_pattern, $xml, $elements);\n\/\/ $elements[1] - \u30bf\u30b0\u540d ('book', 'title', 'author')\n\/\/ $elements[2] - \u30b3\u30f3\u30c6\u30f3\u30c4\n\n\/\/ \u5c5e\u6027\u5024\u306e\u62bd\u51fa\n$attr_pattern = '\/([a-z][a-z0-9]*)\\s*=\\s*([\"\\'])(.*?)\\2\/i';\npreg_match_all($attr_pattern, $xml, $attributes);\n\/\/ $attributes[1] - \u5c5e\u6027\u540d ('id')\n\/\/ $attributes[3] - \u5c5e\u6027\u5024 ('1')\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-31\">\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u89e3\u6790\u306e\u305f\u3081\u306e\u52b9\u7387\u7684\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u62bd\u51fa\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Apache\u5f62\u5f0f\u306e\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u89e3\u6790\n$log_line = '192.168.1.1 - - [15\/Oct\/2023:10:15:32 +0900] \"GET \/page.php HTTP\/1.1\" 200 1234';\n$log_pattern = '\/^(\\S+) \\S+ \\S+ \\[([^:]+):(\\d+:\\d+:\\d+) ([^\\]]+)\\] \"(\\S+) (.*?) (\\S+)\" (\\d+) (\\d+)\/';\npreg_match($log_pattern, $log_line, $parts);\n\/*\n$parts[1] - IP\u30a2\u30c9\u30ec\u30b9\n$parts[2] - \u65e5\u4ed8\n$parts[3] - \u6642\u9593\n$parts[5] - \u30e1\u30bd\u30c3\u30c9\uff08GET\uff09\n$parts[6] - \u30ea\u30af\u30a8\u30b9\u30c8\u30d1\u30b9\n$parts[8] - \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\n*\/\n\n\/\/ \u30a8\u30e9\u30fc\u30ed\u30b0\u304b\u3089\u306e\u4f8b\u5916\u62bd\u51fa\n$error_log = 'PHP Fatal error: Uncaught Exception: Division by zero in \/var\/www\/html\/calc.php:25';\n$error_pattern = '\/PHP (Warning|Notice|Fatal error): (.+) in (.+):(\\d+)\/';\npreg_match($error_pattern, $error_log, $error);\n\/\/ $error[1] - \u30a8\u30e9\u30fc\u7a2e\u5225\n\/\/ $error[2] - \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\n\/\/ $error[3] - \u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\n\/\/ $error[4] - \u884c\u756a\u53f7\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-32\">\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u306e\u691c\u8a3c<\/h3>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u306e\u691c\u8a3c\u3084\u5404\u90e8\u5206\u306e\u62bd\u51fa\u3092\u884c\u3046\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Windows\u30d1\u30b9\u691c\u8a3c\n$win_path = 'C:\\\\Users\\\\Username\\\\Documents\\\\file.txt';\n$win_pattern = '\/^(?:[a-zA-Z]:|\\\\\\\\\\\\\\\\[a-zA-Z0-9_.]+\\\\\\\\[a-zA-Z0-9_.$]+)\\\\\\\\(?:[^\\\\\\\\\/:*?\"&lt;&gt;|]+\\\\\\\\)*[^\\\\\\\\\/:*?\"&lt;&gt;|]*$\/';\n\n\/\/ Unix\u30d1\u30b9\u691c\u8a3c\n$unix_path = '\/var\/www\/html\/index.php';\n$unix_pattern = '\/^(\\\/[^\\\/\\0]+)+\\\/?$\/';\n\n\/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u3068\u62e1\u5f35\u5b50\u306e\u62bd\u51fa\n$path = '\/path\/to\/document.pdf';\npreg_match('\/^(?:.*[\\\\\\\\\\\/])?([^\\\\\\\\\\\/]+)(?:\\.([^.\\\\\\\\\\\/]+))?$\/', $path, $parts);\n\/\/ $parts[1] - \u30d5\u30a1\u30a4\u30eb\u540d ('document')\n\/\/ $parts[2] - \u62e1\u5f35\u5b50 ('pdf')\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-33\">\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u756a\u53f7\u306e\u7a2e\u985e\u5224\u5225\u3068\u691c\u8a3c<\/h3>\n\n\n\n<p>\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u756a\u53f7\u306e\u691c\u8a3c\u3068\u7a2e\u985e\u5224\u5225\u3092\u884c\u3046\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u7a2e\u985e\u5224\u5225\n$cc_patterns = [\n    'visa' =&gt; '\/^4[0-9]{12}(?:[0-9]{3})?$\/',\n    'mastercard' =&gt; '\/^5[1-5][0-9]{14}$\/',\n    'amex' =&gt; '\/^3[47][0-9]{13}$\/',\n    'discover' =&gt; '\/^6(?:011|5[0-9]{2})[0-9]{12}$\/'\n];\n\n$cc_number = '4111111111111111'; \/\/ \u30c6\u30b9\u30c8\u7528Visa\u756a\u53f7\nforeach ($cc_patterns as $type =&gt; $pattern) {\n    if (preg_match($pattern, $cc_number)) {\n        echo \"\u3053\u308c\u306f{$type}\u30ab\u30fc\u30c9\u3067\u3059\";\n        break;\n    }\n}\n\n\/\/ \u30cf\u30a4\u30d5\u30f3\u4ed8\u304d\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3082\u8a31\u5bb9\n$cc_pattern = '\/^(?:4[0-9]{3}|5[1-5][0-9]{2}|3[47][0-9]{2})[- ]?[0-9]{4}[- ]?[0-9]{4}[- ]?[0-9]{4}$\/';\n<\/pre>\n\n\n\n<p>\u6ce8\u610f: \u5b9f\u969b\u306e\u30ab\u30fc\u30c9\u756a\u53f7\u691c\u8a3c\u306b\u306fLuhn\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u3088\u308b\u691c\u8a3c\u3082\u5b9f\u88c5\u3059\u3079\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-34\">IP\u30a2\u30c9\u30ec\u30b9\uff08v4\/v6\uff09\u306e\u691c\u8a3c\u3068\u5909\u63db<\/h3>\n\n\n\n<p>IPv4\u3068IPv6\u30a2\u30c9\u30ec\u30b9\u3092\u691c\u8a3c\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ IPv4\u691c\u8a3c\n$ipv4 = '192.168.1.1';\n$ipv4_pattern = '\/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$\/';\n\nif (preg_match($ipv4_pattern, $ipv4)) {\n    echo \"\u6709\u52b9\u306aIPv4\u30a2\u30c9\u30ec\u30b9\u3067\u3059\";\n}\n\n\/\/ IPv6\u691c\u8a3c\uff08\u7c21\u7565\u5316\u7248\uff09\n$ipv6 = '2001:0db8:85a3:0000:0000:8a2e:0370:7334';\n$ipv6_pattern = '\/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$\/';\n\n\/\/ \u3088\u308a\u5b9f\u7528\u7684\u306a\u306e\u306fPHP\u6a19\u6e96\u95a2\u6570\nif (filter_var($ipv4, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n    echo \"\u6709\u52b9\u306aIPv4\u30a2\u30c9\u30ec\u30b9\u3067\u3059\";\n}\nif (filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n    echo \"\u6709\u52b9\u306aIPv6\u30a2\u30c9\u30ec\u30b9\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-35\">\u90f5\u4fbf\u756a\u53f7\u30fb\u4f4f\u6240\u30c7\u30fc\u30bf\u306e\u6b63\u898f\u5316\u51e6\u7406<\/h3>\n\n\n\n<p>\u90f5\u4fbf\u756a\u53f7\u3068\u4f4f\u6240\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u30fb\u6b63\u898f\u5316\u3092\u884c\u3046\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u672c\u306e\u90f5\u4fbf\u756a\u53f7\uff08\u30cf\u30a4\u30d5\u30f3\u3042\u308a\/\u306a\u3057\u4e21\u5bfe\u5fdc\uff09\n$zip_pattern = '\/^(\\d{3})[-]?(\\d{4})$\/';\n$zip = '123-4567';\nif (preg_match($zip_pattern, $zip, $matches)) {\n    \/\/ \u6b63\u898f\u5316\uff08\u30cf\u30a4\u30d5\u30f3\u3042\u308a\u5f62\u5f0f\u306b\u7d71\u4e00\uff09\n    $normalized = $matches[1] . '-' . $matches[2];\n    echo $normalized; \/\/ \"123-4567\"\n}\n\n\/\/ \u4f4f\u6240\u306e\u90fd\u9053\u5e9c\u770c\u62bd\u51fa\n$address = '\u6771\u4eac\u90fd\u65b0\u5bbf\u533a\u897f\u65b0\u5bbf2-8-1';\n$prefecture_pattern = '\/^(\u5317\u6d77\u9053|\u6771\u4eac\u90fd|(?:\u4eac\u90fd|\u5927\u962a)\u5e9c|.{2,3}\u770c)\/u';\npreg_match($prefecture_pattern, $address, $prefecture);\n\/\/ $prefecture[1] = \"\u6771\u4eac\u90fd\"\n\n\/\/ \u5e02\u533a\u753a\u6751\u62bd\u51fa\n$city_pattern = '\/[\u90fd\u9053\u5e9c\u770c](.+?[\u5e02\u533a\u753a\u6751])\/u';\npreg_match($city_pattern, $address, $city);\n\/\/ $city[1] = \"\u65b0\u5bbf\u533a\"\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308b\u969b\u306b\u306f\u9069\u5b9c\u8abf\u6574\u304c\u5fc5\u8981\u3067\u3059\u3002\u7279\u306b\u56fd\u969b\u5bfe\u5fdc\u3092\u884c\u3046\u5834\u5408\u306f\u3001\u5404\u56fd\u30fb\u5730\u57df\u306e\u56fa\u6709\u306e\u5f62\u5f0f\u306b\u5408\u308f\u305b\u305f\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u3088\u308a\u8907\u96d1\u306a\u30c7\u30fc\u30bf\u691c\u8a3c\u306b\u306f\u3001\u5c02\u7528\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30d6\u30e9\u30ea\u3084PHP\u306e\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306e\u4f7f\u7528\u3082\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-36\">\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u8853<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u4e0d\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4e0a\u306e\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3084\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u6700\u9069\u5316\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001PHP\u3067\u306e\u6b63\u898f\u8868\u73fe\u51e6\u7406\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-37\">\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u6291\u5236\u3059\u308b\u66f8\u304d\u65b9\u306e\u30b3\u30c4<\/h3>\n\n\n\n<p><strong>\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0<\/strong>\u3068\u306f\u3001\u6b63\u898f\u8868\u73fe\u30a8\u30f3\u30b8\u30f3\u304c\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u5931\u6557\u3057\u305f\u969b\u306b\u524d\u306e\u72b6\u614b\u306b\u623b\u308a\u3001\u5225\u306e\u53ef\u80fd\u6027\u3092\u8a66\u884c\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u3067\u3059\u3002\u904e\u5ea6\u306e\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306f\u3001\u300c\u30ab\u30bf\u30b9\u30c8\u30ed\u30d5\u30a3\u30c3\u30af\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u300d\u3068\u547c\u3070\u308c\u308b\u6df1\u523b\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-38\">\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u304c\u591a\u767a\u3059\u308b\u30d1\u30bf\u30fc\u30f3<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u5f15\u304d\u8d77\u3053\u3057\u3084\u3059\u3044\u305f\u3081\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8caa\u6b32\u306a\u91cf\u6307\u5b9a\u5b50\uff08<code>*<\/code>, <code>+<\/code>, <code>{n,m}<\/code>\uff09\u306e\u904e\u5270\u4f7f\u7528<\/li>\n\n\n\n<li>\u9023\u7d9a\u3059\u308b\u91cf\u6307\u5b9a\u5b50\uff08\u4f8b\uff1a<code>.*.*<\/code>\uff09<\/li>\n\n\n\n<li>\u66d6\u6627\u306a\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3\uff08\u4f8b\uff1a<code>(A|AB)C<\/code>\uff09<\/li>\n\n\n\n<li>\u5165\u308c\u5b50\u306b\u306a\u3063\u305f\u7e70\u308a\u8fd4\u3057\uff08\u4f8b\uff1a<code>(a+)+<\/code>\uff09<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-39\">\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff1a\u904e\u5ea6\u306e\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u5f15\u304d\u8d77\u3053\u3059\n$pattern = '\/A.*B.*C\/';\n\n\/\/ \u826f\u3044\u4f8b\uff1a\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u6700\u5c0f\u5316\n$pattern = '\/A[^B]*B[^C]*C\/';\n<\/pre>\n\n\n<div id=\"id-540ecb5b-03b9-48e0-a7f2-76fbcdb30244\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30c6\u30af\u30cb\u30c3\u30af<\/th><th>\u8aac\u660e<\/th><th>\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>\u975e\u8caa\u6b32\u91cf\u6307\u5b9a\u5b50<\/td><td><code>*?<\/code>, <code>+?<\/code>, <code>{n,m}?<\/code> \u3092\u4f7f\u7528<\/td><td><code>\/a.+?b\/<\/code><\/td><\/tr><tr><td>\u30a2\u30f3\u30ab\u30fc\u306e\u6d3b\u7528<\/td><td><code>^<\/code>, <code>$<\/code>, <code>\\b<\/code> \u3067\u7bc4\u56f2\u3092\u9650\u5b9a<\/td><td><code>\/^prefix\/<\/code><\/td><\/tr><tr><td>\u8a73\u7d30\u306a\u6587\u5b57\u30af\u30e9\u30b9<\/td><td>\u53ef\u80fd\u306a\u9650\u308a\u5177\u4f53\u7684\u306b\u6307\u5b9a<\/td><td><code>\/[0-9]\/<\/code> \u3088\u308a <code>\/[13579]\/<\/code><\/td><\/tr><tr><td>\u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7<\/td><td><code>(?&gt;...)<\/code> \u3067\u4e00\u5ea6\u30de\u30c3\u30c1\u3057\u305f\u3089\u56fa\u5b9a<\/td><td><code>\/a(?&gt;bc|b)c\/<\/code><\/td><\/tr><tr><td>\u56fa\u5b9a\u5e45\u30d1\u30bf\u30fc\u30f3<\/td><td>\u53ef\u5909\u5e45\u3088\u308a\u56fa\u5b9a\u5e45\u304c\u9ad8\u901f<\/td><td><code>\/\\d{3}\/<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u7279\u306b\u5f37\u529b\u306a\u306e\u306f<strong>\u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7<\/strong>\u3067\u3059\u3002\u4e00\u5ea6\u30de\u30c3\u30c1\u3057\u305f\u30d1\u30bf\u30fc\u30f3\u304c\u5f8c\u7d9a\u306e\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u5931\u6557\u3057\u3066\u3082\u3001\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u5185\u3067\u306f\u5225\u306e\u53ef\u80fd\u6027\u3092\u63a2\u7d22\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u901a\u5e38\u306e\u30b0\u30eb\u30fc\u30d7 - \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3042\u308a\n$pattern1 = '\/(ab|abc)x\/';\n\n\/\/ \u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7 - \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306a\u3057\n$pattern2 = '\/(?&gt;(ab|abc))x\/';\n\n\/\/ \"abcx\" \u306b\u5bfe\u3057\u3066 pattern1 \u306f \"abc\" \u306b\u30de\u30c3\u30c1\u3057\u3066\u304b\u3089 \"x\" \u306b\u30de\u30c3\u30c1\n\/\/ \"abcx\" \u306b\u5bfe\u3057\u3066 pattern2 \u306f \"ab\" \u306b\u30de\u30c3\u30c1\u3057\u305f\u5f8c\u3001\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u305b\u305a\u3001\u5931\u6557\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-40\">\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6d3b\u7528\u3057\u305f\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306e\u9ad8\u901f\u5316<\/h3>\n\n\n\n<p>PHP\u306f\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u5185\u90e8\u7684\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u4e2d\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u307e\u3059\u3002\u3053\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u52b9\u7387\u7684\u306b\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u9ad8\u901f\u5316\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-41\">\u30d1\u30bf\u30fc\u30f3\u306e\u5909\u6570\u5316\u3068\u30eb\u30fc\u30d7\u5916\u5b9a\u7fa9<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff1a\u30eb\u30fc\u30d7\u5185\u3067\u30d1\u30bf\u30fc\u30f3\u3092\u6bce\u56de\u751f\u6210\nforeach ($items as $item) {\n    if (preg_match('\/^prefix_' . $some_variable . '_\\d+$\/', $item)) {\n        \/\/ \u51e6\u7406\n    }\n}\n\n\/\/ \u826f\u3044\u4f8b\uff1a\u30d1\u30bf\u30fc\u30f3\u3092\u30eb\u30fc\u30d7\u5916\u3067\u5b9a\u7fa9\n$pattern = '\/^prefix_' . $some_variable . '_\\d+$\/';\nforeach ($items as $item) {\n    if (preg_match($pattern, $item)) {\n        \/\/ \u51e6\u7406\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-42\">\u9759\u7684\u30d1\u30bf\u30fc\u30f3\u306e\u512a\u4f4d\u6027<\/h4>\n\n\n\n<p>\u540c\u3058\u30d1\u30bf\u30fc\u30f3\u3092\u4f55\u5ea6\u3082\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6587\u5b57\u5217\u9023\u7d50\u3084\u5909\u6570\u5c55\u958b\u3092\u4f7f\u308f\u306a\u3044\u9759\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u306e\u65b9\u304c\u52b9\u7387\u7684\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u52d5\u7684\u30d1\u30bf\u30fc\u30f3\uff08\u5fc5\u8981\u306a\u5834\u5408\u306e\u307f\uff09\n$pattern = '\/^' . preg_quote($user_input, '\/') . '$\/';\n\n\/\/ \u53ef\u80fd\u3067\u3042\u308c\u3070\u9759\u7684\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\n$static_pattern = '\/^[a-z0-9]+$\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-43\">\u5b9f\u8df5\u7684\u306a\u30ad\u30e3\u30c3\u30b7\u30e5\u6d3b\u7528\u4f8b<\/h4>\n\n\n\n<p>\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u540c\u3058\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3059\u5834\u5408\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function process_data($data_array) {\n    \/\/ \u30d1\u30bf\u30fc\u30f3\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u305f\u3081\u306b\u95a2\u6570\u306e\u5916\u5074\u3067\u5b9a\u7fa9\n    static $patterns = [\n        'email' =&gt; '\/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$\/',\n        'phone' =&gt; '\/^\\d{2,4}-\\d{2,4}-\\d{4}$\/',\n        'zipcode' =&gt; '\/^\\d{3}-\\d{4}$\/'\n    ];\n    \n    $results = [];\n    foreach ($data_array as $item) {\n        $validation = [\n            'valid_email' =&gt; preg_match($patterns['email'], $item['email']),\n            'valid_phone' =&gt; preg_match($patterns['phone'], $item['phone']),\n            'valid_zipcode' =&gt; preg_match($patterns['zipcode'], $item['zipcode'])\n        ];\n        $results[] = $validation;\n    }\n    return $results;\n}\n<\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001<code>static<\/code> \u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30d1\u30bf\u30fc\u30f3\u3092\u4e00\u5ea6\u3060\u3051\u5b9a\u7fa9\u3057\u3001\u95a2\u6570\u306e\u8907\u6570\u56de\u306e\u547c\u3073\u51fa\u3057\u3067\u3082\u518d\u5229\u7528\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-44\">\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3092\u5206\u5272\u3057\u3066\u53ef\u8aad\u6027\u3068\u52b9\u7387\u3092\u5411\u4e0a<\/h3>\n\n\n\n<p>\u975e\u5e38\u306b\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u306f\u3001\u4fdd\u5b88\u6027\u306e\u4f4e\u4e0b\u3060\u3051\u3067\u306a\u304f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c\u3082\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u8907\u6570\u306e\u5358\u7d14\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u5206\u5272\u3059\u308b\u3053\u3068\u3067\u3001\u53ef\u8aad\u6027\u3068\u52b9\u7387\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-45\">\u5206\u5272\u306e\u5224\u65ad\u57fa\u6e96<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3044\u305a\u308c\u304b\u306b\u8a72\u5f53\u3059\u308b\u5834\u5408\u3001\u6b63\u898f\u8868\u73fe\u306e\u5206\u5272\u3092\u691c\u8a0e\u3059\u3079\u304d\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30bf\u30fc\u30f3\u304c100\u6587\u5b57\u3092\u8d85\u3048\u3066\u3044\u308b<\/li>\n\n\n\n<li>\u8907\u6570\u306e\u72ec\u7acb\u3057\u305f\u6761\u4ef6\u3092\u542b\u3093\u3067\u3044\u308b<\/li>\n\n\n\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c\u304c\u767a\u751f\u3057\u3066\u3044\u308b<\/li>\n\n\n\n<li>\u30d1\u30bf\u30fc\u30f3\u306e\u4fdd\u5b88\u304c\u56f0\u96e3\u306b\u306a\u3063\u3066\u3044\u308b<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-46\">\u5206\u5272\u30a2\u30d7\u30ed\u30fc\u30c1<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff1a1\u3064\u306e\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3067\u5168\u3066\u3092\u691c\u8a3c\n$complex_pattern = '\/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&amp;])[A-Za-z\\d@$!%*?&amp;]{8,}$\/';\nif (preg_match($complex_pattern, $password)) {\n    \/\/ \u6709\u52b9\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\n}\n\n\/\/ \u826f\u3044\u4f8b\uff1a\u8907\u6570\u306e\u5358\u7d14\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u5206\u5272\n$validations = [\n    'length' =&gt; strlen($password) &gt;= 8,\n    'lowercase' =&gt; preg_match('\/[a-z]\/', $password),\n    'uppercase' =&gt; preg_match('\/[A-Z]\/', $password),\n    'digit' =&gt; preg_match('\/\\d\/', $password),\n    'special' =&gt; preg_match('\/[@$!%*?&amp;]\/', $password)\n];\n\nif (!in_array(false, $validations, true)) {\n    \/\/ \u6709\u52b9\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\n}\n<\/pre>\n\n\n\n<p>\u3053\u306e\u5206\u5272\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u306f\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u53ef\u8aad\u6027<\/strong>: \u5404\u691c\u8a3c\u306e\u76ee\u7684\u304c\u660e\u78ba<\/li>\n\n\n\n<li><strong>\u4fdd\u5b88\u6027<\/strong>: \u6761\u4ef6\u306e\u8ffd\u52a0\u30fb\u5909\u66f4\u304c\u5bb9\u6613<\/li>\n\n\n\n<li><strong>\u30c7\u30d0\u30c3\u30b0<\/strong>: \u5931\u6557\u306e\u539f\u56e0\u3092\u7279\u5b9a\u3057\u3084\u3059\u3044<\/li>\n\n\n\n<li><strong>\u518d\u5229\u7528<\/strong>: \u90e8\u5206\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u5225\u306e\u7528\u9014\u306b\u518d\u5229\u7528\u53ef\u80fd<\/li>\n\n\n\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/strong>: \u500b\u3005\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u9ad8\u901f\u306b\u51e6\u7406\u53ef\u80fd<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-47\">\u6bb5\u968e\u7684\u51e6\u7406\u306e\u4f8b<\/h4>\n\n\n\n<p>\u8907\u96d1\u306a\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u3092\u6bb5\u968e\u7684\u306b\u884c\u3046\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u524d\u51e6\u7406\uff1a\u4f59\u5206\u306a\u7a7a\u767d\u3092\u524a\u9664\n$text = preg_replace('\/\\s+\/', ' ', $text);\n\n\/\/ \u4e3b\u51e6\u7406\uff1aE\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u62bd\u51fa\npreg_match_all('\/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\/', $text, $emails);\n\n\/\/ \u5f8c\u51e6\u7406\uff1a\u62bd\u51fa\u3057\u305f\u30a2\u30c9\u30ec\u30b9\u3092\u691c\u8a3c\n$valid_emails = [];\nforeach ($emails[0] as $email) {\n    if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n        $valid_emails[] = $email;\n    }\n}\n<\/pre>\n\n\n\n<p>\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3092\u5206\u5272\u3059\u308b\u969b\u306f\u3001\u5404\u30d1\u30bf\u30fc\u30f3\u304c\u4f55\u3092\u9054\u6210\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u304b\u3092\u660e\u78ba\u306b\u30b3\u30e1\u30f3\u30c8\u3067\u8a18\u9332\u3059\u308b\u3053\u3068\u3082\u91cd\u8981\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5c06\u6765\u306e\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306e\u6700\u9069\u5316\u306f\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u9069\u5207\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u7570\u306a\u308a\u307e\u3059\u3002\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u3067\u5341\u5206\u306b\u30c6\u30b9\u30c8\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6e2c\u5b9a\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u5c0f\u3055\u306a\u5909\u66f4\u304c\u5927\u304d\u306a\u9055\u3044\u3092\u751f\u307f\u51fa\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-48\">\u6b63\u898f\u8868\u73fe\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u5bfe\u7b56<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u9069\u5207\u306b\u4f7f\u7528\u3057\u306a\u3044\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3092\u3082\u305f\u3089\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u4e3b\u306a\u6b63\u898f\u8868\u73fe\u306b\u95a2\u9023\u3059\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u305d\u306e\u5bfe\u7b56\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-49\">\u6b63\u898f\u8868\u73feDoS\u653b\u6483\uff08ReDoS\uff09\u3092\u9632\u3050\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08<\/h3>\n\n\n\n<p>**ReDoS\uff08Regular Expression Denial of Service\uff09**\u3068\u306f\u3001\u5de7\u5999\u306b\u4f5c\u3089\u308c\u305f\u5165\u529b\u306b\u3088\u3063\u3066\u6b63\u898f\u8868\u73fe\u306e\u30de\u30c3\u30c1\u30f3\u30b0\u51e6\u7406\u304c\u7570\u5e38\u306b\u9577\u6642\u9593\u304b\u304b\u308b\u3088\u3046\u306b\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u30ea\u30bd\u30fc\u30b9\u3092\u67af\u6e07\u3055\u305b\u308b\u653b\u6483\u3067\u3059\u3002\u3053\u306e\u653b\u6483\u306f\u3001\u6b63\u898f\u8868\u73fe\u30a8\u30f3\u30b8\u30f3\u306e\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306e\u4ed5\u7d44\u307f\u3092\u60aa\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-50\">ReDoS\u653b\u6483\u306e\u4ed5\u7d44\u307f<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5371\u967a\u306a\u30d1\u30bf\u30fc\u30f3\u4f8b\n$pattern = '\/(a+)+b\/';\n$input = 'aaaaaaaaaaaaaaaaaaaaaaaaaX'; \/\/ \u60aa\u610f\u3042\u308b\u5165\u529b\n\n\/\/ \u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3068\u5165\u529b\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u51e6\u7406\u6642\u9593\u304c\u6307\u6570\u95a2\u6570\u7684\u306b\u5897\u52a0\n$start = microtime(true);\npreg_match($pattern, $input);\n$end = microtime(true);\necho \"\u51e6\u7406\u6642\u9593: \" . ($end - $start) . \"\u79d2\";\n\/\/ \u5165\u529b\u304c\u9577\u304f\u306a\u308b\u307b\u3069\u51e6\u7406\u6642\u9593\u304c\u7206\u767a\u7684\u306b\u5897\u52a0\n<\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306e\u554f\u984c\u70b9\u306f\u3001<code>(a+)+<\/code> \u3068\u3044\u3046<strong>\u5165\u308c\u5b50\u306b\u306a\u3063\u305f\u7e70\u308a\u8fd4\u3057<\/strong>\u69cb\u9020\u306b\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u300ca\u300d\u304c\u591a\u6570\u9023\u7d9a\u3057\u305f\u5f8c\u306b\u300cb\u300d\u304c\u306a\u3044\u5834\u5408\u3001\u6307\u6570\u95a2\u6570\u7684\u306a\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-51\">\u5b89\u5168\u306a\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08\u306e\u30dd\u30a4\u30f3\u30c8<\/h4>\n\n\n<div id=\"id-f9ea9381-1976-4220-b953-3ee9b883989f\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5371\u967a\u306a\u30d1\u30bf\u30fc\u30f3<\/th><th>\u5b89\u5168\u306a\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>(a+)+b<\/code><\/td><td><code>a+b<\/code><\/td><td>\u5165\u308c\u5b50\u306e\u7e70\u308a\u8fd4\u3057\u3092\u6392\u9664<\/td><\/tr><tr><td><code>(a|a)+<\/code><\/td><td><code>a+<\/code><\/td><td>\u91cd\u8907\u3059\u308b\u9078\u629e\u80a2\u3092\u6392\u9664<\/td><\/tr><tr><td><code>.*.*<\/code><\/td><td><code>.*<\/code><\/td><td>\u9023\u7d9a\u3059\u308b\u91cf\u6307\u5b9a\u5b50\u3092\u7d71\u5408<\/td><\/tr><tr><td><code>(x+x+)+y<\/code><\/td><td><code>x+y<\/code><\/td><td>\u8907\u96d1\u306a\u5165\u308c\u5b50\u30d1\u30bf\u30fc\u30f3\u3092\u5358\u7d14\u5316<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>\u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7<\/strong>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u52b9\u679c\u7684\u306a\u5bfe\u7b56\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u901a\u5e38\u306e\u30b0\u30eb\u30fc\u30d7 - \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3042\u308a\uff08\u5371\u967a\uff09\n$pattern1 = '\/(a+)+b\/';\n\n\/\/ \u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7 - \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306a\u3057\uff08\u5b89\u5168\uff09\n$pattern2 = '\/(?&gt;a+)+b\/';\n<\/pre>\n\n\n\n<p>\u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7 <code>(?&gt;...)<\/code> \u306f\u3001\u4e00\u5ea6\u30de\u30c3\u30c1\u3057\u305f\u30d1\u30bf\u30fc\u30f3\u3092\u300c\u78ba\u5b9a\u300d\u3055\u305b\u3001\u5f8c\u7d9a\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u30de\u30c3\u30c1\u3057\u306a\u304f\u3066\u3082\u5143\u306b\u623b\u3063\u3066\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u884c\u308f\u306a\u3044\u305f\u3081\u3001ReDoS\u653b\u6483\u306e\u30ea\u30b9\u30af\u3092\u5927\u5e45\u306b\u6e1b\u5c11\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u4ed6\u306e\u91cd\u8981\u306a\u5bfe\u7b56\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30a2\u30f3\u30ab\u30fc<\/strong>: <code>^<\/code> \u3068 `## \u6b63\u898f\u8868\u73fe\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u5bfe\u7b56<\/li>\n<\/ul>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u9069\u5207\u306b\u4f7f\u7528\u3057\u306a\u3044\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3092\u3082\u305f\u3089\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u4e3b\u306a\u6b63\u898f\u8868\u73fe\u306b\u95a2\u9023\u3059\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u305d\u306e\u5bfe\u7b56\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-52\">\u6b63\u898f\u8868\u73feDoS\u653b\u6483\uff08ReDoS\uff09\u3092\u9632\u3050\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08<\/h3>\n\n\n\n<p>**ReDoS\uff08Regular Expression Denial of Service\uff09**\u3068\u306f\u3001\u5de7\u5999\u306b\u4f5c\u3089\u308c\u305f\u5165\u529b\u306b\u3088\u3063\u3066\u6b63\u898f\u8868\u73fe\u306e\u30de\u30c3\u30c1\u30f3\u30b0\u51e6\u7406\u304c\u7570\u5e38\u306b\u9577\u6642\u9593\u304b\u304b\u308b\u3088\u3046\u306b\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u30ea\u30bd\u30fc\u30b9\u3092\u67af\u6e07\u3055\u305b\u308b\u653b\u6483\u3067\u3059\u3002\u3053\u306e\u653b\u6483\u306f\u3001\u6b63\u898f\u8868\u73fe\u30a8\u30f3\u30b8\u30f3\u306e\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306e\u4ed5\u7d44\u307f\u3092\u60aa\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-53\">ReDoS\u653b\u6483\u306e\u4ed5\u7d44\u307f<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5371\u967a\u306a\u30d1\u30bf\u30fc\u30f3\u4f8b\n$pattern = '\/(a+)+b\/';\n$input = 'aaaaaaaaaaaaaaaaaaaaaaaaaX'; \/\/ \u60aa\u610f\u3042\u308b\u5165\u529b\n\n\/\/ \u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3068\u5165\u529b\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u51e6\u7406\u6642\u9593\u304c\u6307\u6570\u95a2\u6570\u7684\u306b\u5897\u52a0\n$start = microtime(true);\npreg_match($pattern, $input);\n$end = microtime(true);\necho \"\u51e6\u7406\u6642\u9593: \" . ($end - $start) . \"\u79d2\";\n\/\/ \u5165\u529b\u304c\u9577\u304f\u306a\u308b\u307b\u3069\u51e6\u7406\u6642\u9593\u304c\u7206\u767a\u7684\u306b\u5897\u52a0\n<\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306e\u554f\u984c\u70b9\u306f\u3001<code>(a+)+<\/code> \u3068\u3044\u3046<strong>\u5165\u308c\u5b50\u306b\u306a\u3063\u305f\u7e70\u308a\u8fd4\u3057<\/strong>\u69cb\u9020\u306b\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u300ca\u300d\u304c\u591a\u6570\u9023\u7d9a\u3057\u305f\u5f8c\u306b\u300cb\u300d\u304c\u306a\u3044\u5834\u5408\u3001\u6307\u6570\u95a2\u6570\u7684\u306a\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-54\">\u5b89\u5168\u306a\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08\u306e\u30dd\u30a4\u30f3\u30c8<\/h4>\n\n\n<div id=\"id-865fdb5c-4d53-48fa-8d6f-f824ab5f84dd\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5371\u967a\u306a\u30d1\u30bf\u30fc\u30f3<\/th><th>\u5b89\u5168\u306a\u4ee3\u66ff\u30d1\u30bf\u30fc\u30f3<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>(a+)+b<\/code><\/td><td><code>a+b<\/code><\/td><td>\u5165\u308c\u5b50\u306e\u7e70\u308a\u8fd4\u3057\u3092\u6392\u9664<\/td><\/tr><tr><td><code>(a|a)+<\/code><\/td><td><code>a+<\/code><\/td><td>\u91cd\u8907\u3059\u308b\u9078\u629e\u80a2\u3092\u6392\u9664<\/td><\/tr><tr><td><code>.*.*<\/code><\/td><td><code>.*<\/code><\/td><td>\u9023\u7d9a\u3059\u308b\u91cf\u6307\u5b9a\u5b50\u3092\u7d71\u5408<\/td><\/tr><tr><td><code>(x+x+)+y<\/code><\/td><td><code>x+y<\/code><\/td><td>\u8907\u96d1\u306a\u5165\u308c\u5b50\u30d1\u30bf\u30fc\u30f3\u3092\u5358\u7d14\u5316<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>\u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7<\/strong>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u52b9\u679c\u7684\u306a\u5bfe\u7b56\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u901a\u5e38\u306e\u30b0\u30eb\u30fc\u30d7 - \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3042\u308a\uff08\u5371\u967a\uff09\n$pattern1 = '\/(a+)+b\/';\n\n\/\/ \u30a2\u30c8\u30df\u30c3\u30af\u30b0\u30eb\u30fc\u30d7 - \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306a\u3057\uff08\u5b89\u5168\uff09\n$pattern2 = '\/(?&gt;a+)+b\/';\n<\/pre>\n\n\n\n<p>\u3092\u4f7f\u7528\u3057\u3066\u6587\u5b57\u5217\u306e\u5148\u982d\u3068\u672b\u5c3e\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30c3\u30c1\u30f3\u30b0\u7bc4\u56f2\u3092\u9650\u5b9a\u3059\u308b<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5177\u4f53\u7684\u306a\u6587\u5b57\u30af\u30e9\u30b9<\/strong>: <code>.*<\/code> \u306e\u3088\u3046\u306a\u6c4e\u7528\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u306a\u304f\u3001<code>[a-zA-Z0-9]<\/code> \u306e\u3088\u3046\u306a\u5177\u4f53\u7684\u306a\u6587\u5b57\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b<\/li>\n\n\n\n<li><strong>\u91cf\u6307\u5b9a\u5b50\u306e\u5236\u9650<\/strong>: <code>{0,100}<\/code> \u306e\u3088\u3046\u306b\u4e0a\u9650\u3092\u8a2d\u3051\u308b<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-55\">\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u6b63\u898f\u8868\u73fe\u3067\u51e6\u7406\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u6b63\u898f\u8868\u73fe\u3067\u51e6\u7406\u3059\u308b\u969b\u306f\u3001\u8907\u6570\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u306b\u6ce8\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-56\">\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u30d1\u30bf\u30fc\u30f3\u306b\u542b\u3081\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/h4>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u5143\u306b\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u5834\u5408\u306f\u7279\u306b\u5371\u967a\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5371\u967a\u306a\u4f8b - \u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u76f4\u63a5\u30d1\u30bf\u30fc\u30f3\u306b\u4f7f\u7528\n$user_input = $_GET['search'];\n$pattern = '\/^' . $user_input . '$\/';  \/\/ \u5371\u967a\uff01\npreg_match($pattern, $subject);\n\n\/\/ \u5b89\u5168\u306a\u4f8b - preg_quote\u3067\u30e1\u30bf\u6587\u5b57\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\n$user_input = $_GET['search'];\n$pattern = '\/^' . preg_quote($user_input, '\/') . '$\/';\npreg_match($pattern, $subject);\n<\/pre>\n\n\n\n<p><code>preg_quote()<\/code> \u95a2\u6570\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u30e1\u30bf\u6587\u5b57\uff08<code>.*+?^$()[]{}|\\\/<\/code>\uff09\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u3001\u610f\u56f3\u3057\u306a\u3044\u30d1\u30bf\u30fc\u30f3\u306e\u52d5\u4f5c\u3092\u9632\u304e\u307e\u3059\u3002\u7b2c\u4e8c\u5f15\u6570\u306b\u306f\u30c7\u30ea\u30df\u30bf\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-57\">\u5165\u529b\u691c\u8a3c\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8\u30a2\u30d7\u30ed\u30fc\u30c1<\/strong>\uff1a\u8a31\u53ef\u3059\u308b\u5165\u529b\u30d1\u30bf\u30fc\u30f3\u3092\u660e\u793a\u7684\u306b\u5b9a\u7fa9<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff08\u30d6\u30e9\u30c3\u30af\u30ea\u30b9\u30c8 - \u5371\u967a\u306a\u53ef\u80fd\u6027\uff09\nif (!preg_match('\/[&lt;&gt;\\'\"]\/', $input)) {\n    \/\/ \u51e6\u7406\u3092\u7d9a\u884c\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8 - \u5b89\u5168\uff09\nif (preg_match('\/^[a-zA-Z0-9\\s]+$\/', $input)) {\n    \/\/ \u51e6\u7406\u3092\u7d9a\u884c\n}\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u5165\u529b\u306e\u9577\u3055\u5236\u9650<\/strong>\uff1a\u6975\u7aef\u306b\u9577\u3044\u5165\u529b\u3092\u62d2\u5426\u3059\u308b<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if (strlen($input) &gt; 100) {\n    die('\u5165\u529b\u304c\u9577\u3059\u304e\u307e\u3059');\n}\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u5c02\u7528\u306e\u691c\u8a3c\u95a2\u6570\u3092\u512a\u5148<\/strong>\uff1a\u53ef\u80fd\u306a\u5834\u5408\u306f\u6b63\u898f\u8868\u73fe\u3088\u308a\u3082\u5c02\u7528\u95a2\u6570\u3092\u4f7f\u7528<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6b63\u898f\u8868\u73fe\u3088\u308a\u5b89\u5168\u3067\u9ad8\u901f\nif (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n    \/\/ \u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-58\">\u30a8\u30e9\u30fc\u51e6\u7406\u3068\u60c5\u5831\u6f0f\u6d29\u306e\u9632\u6b62<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u51e6\u7406\u306e\u30a8\u30e9\u30fc\u304b\u3089\u60c5\u5831\u304c\u6f0f\u6d29\u3057\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u672c\u756a\u74b0\u5883\u3067\u306e\u5b89\u5168\u306a\u30a8\u30e9\u30fc\u51e6\u7406\n$result = @preg_match($pattern, $subject);\nif ($result === false) {\n    \/\/ \u30a8\u30e9\u30fc\u3092\u9069\u5207\u306b\u30ed\u30b0\u306b\u8a18\u9332\uff08\u30e6\u30fc\u30b6\u30fc\u306b\u306f\u8868\u793a\u3057\u306a\u3044\uff09\n    error_log('\u6b63\u898f\u8868\u73fe\u30a8\u30e9\u30fc: ' . preg_last_error());\n    die('\u51e6\u7406\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f');\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-59\">\u5b89\u5168\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306e\u305f\u3081\u306ePHP\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<p>PHP\u306e\u8a2d\u5b9a\u3092\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u6b63\u898f\u8868\u73fe\u306b\u95a2\u9023\u3059\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3092\u8efd\u6e1b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-60\">\u91cd\u8981\u306a\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf<\/h4>\n\n\n<div id=\"id-12a42b77-aaff-4ce7-a1f4-e086e0b8b955\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a2d\u5b9a\u540d<\/th><th>\u8aac\u660e<\/th><th>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/th><th>\u63a8\u5968\u8a2d\u5b9a<\/th><\/tr><\/thead><tbody><tr><td>pcre.backtrack_limit<\/td><td>\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u306e\u6700\u5927\u56de\u6570<\/td><td>1,000,000<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5408\u308f\u305b\u3066\u8abf\u6574<\/td><\/tr><tr><td>pcre.recursion_limit<\/td><td>\u518d\u5e30\u306e\u6700\u5927\u6df1\u3055<\/td><td>100,000<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5408\u308f\u305b\u3066\u8abf\u6574<\/td><\/tr><tr><td>max_execution_time<\/td><td>\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u6642\u9593\u306e\u4e0a\u9650\uff08\u79d2\uff09<\/td><td>30<\/td><td>\u9069\u5207\u306a\u5024\u306b\u8a2d\u5b9a\uff08\u7121\u5236\u9650\u306f\u5371\u967a\uff09<\/td><\/tr><tr><td>memory_limit<\/td><td>\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u4f7f\u7528\u53ef\u80fd\u306a\u30e1\u30e2\u30ea\u4e0a\u9650<\/td><td>128M<\/td><td>\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u8a2d\u5b9a<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u306f<code>php.ini<\/code>\u30d5\u30a1\u30a4\u30eb\u3067\u884c\u3046\u304b\u3001\u5b9f\u884c\u6642\u306b<code>ini_set()<\/code>\u95a2\u6570\u3067\u5909\u66f4\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5b9f\u884c\u6642\u306e\u8a2d\u5b9a\u4f8b\nini_set('pcre.backtrack_limit', '500000');\nini_set('max_execution_time', '10');  \/\/ 10\u79d2\u3067\u5f37\u5236\u7d42\u4e86\n\n\/\/ \u51e6\u7406\u524d\u306b\u73fe\u5728\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\necho \"\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u5236\u9650: \" . ini_get('pcre.backtrack_limit');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-61\">\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u8a2d\u5b9a<\/h4>\n\n\n\n<p>\u672c\u756a\u74b0\u5883\u3067\u306f\u3001\u8a73\u7d30\u306a\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u30e6\u30fc\u30b6\u30fc\u306b\u8868\u793a\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u672c\u756a\u74b0\u5883\u5411\u3051\u8a2d\u5b9a\nini_set('display_errors', 0);\nini_set('log_errors', 1);\nini_set('error_log', '\/path\/to\/php-error.log');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-62\">\u30bb\u30ad\u30e5\u30a2\u306a\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306e\u4f8b<\/h4>\n\n\n\n<p>\u5b89\u5168\u6027\u3092\u8003\u616e\u3057\u305f\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306e\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ E\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff08\u9577\u3055\u5236\u9650\u3042\u308a\uff09\n$safe_email = '\/^[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]{1,255}\\.[a-zA-Z]{2,}$\/';\n\n\/\/ URL\uff08\u9577\u3055\u3068\u968e\u5c64\u306b\u5236\u9650\u3042\u308a\uff09\n$safe_url = '\/^https?:\\\/\\\/(?:[a-zA-Z0-9-]{1,63}\\.){1,5}[a-zA-Z]{2,}(?:\\\/[^\\s]{0,100})?$\/';\n\n\/\/ HTML\u30bf\u30b0\uff08\u5165\u308c\u5b50\u5236\u9650\u3042\u308a\uff09\n$safe_html_tag = '\/&lt;([a-zA-Z][a-zA-Z0-9]*)[^&gt;]{0,200}&gt;((?:[^&lt;]|&lt;(?!\\\/\\1&gt;)){0,1000})&lt;\\\/\\1&gt;\/s';\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u30de\u30c3\u30c1\u3055\u305b\u308b\u5bfe\u8c61\u306e\u9577\u3055\u3084\u8907\u96d1\u3055\u306b\u660e\u793a\u7684\u306a\u5236\u9650\u3092\u8a2d\u3051\u308b\u3053\u3068\u3067\u3001\u653b\u6483\u30ea\u30b9\u30af\u3092\u4f4e\u6e1b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5168\u4f53\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6226\u7565\u306e\u4e00\u90e8\u3068\u3057\u3066\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5b9a\u671f\u7684\u306a\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u3084\u8106\u5f31\u6027\u30b9\u30ad\u30e3\u30f3\u3082\u4f75\u305b\u3066\u5b9f\u65bd\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-63\">PHP\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u6d3b\u7528\u4f8b<\/h2>\n\n\n\n<p>PHP\u306e\u4e3b\u8981\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084CMS\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u304c\u69d8\u3005\u306a\u5f62\u3067\u6d3b\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001Laravel\u3001Symfony\u3001WordPress\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u5b9f\u8df5\u7684\u306a\u6d3b\u7528\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u305f\u958b\u767a\u3067\u3088\u308a\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-64\">Laravel\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3067\u306e\u9ad8\u5ea6\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/h3>\n\n\n\n<p>Laravel\u3067\u306f\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u5b9a\u7fa9\u306b\u304a\u3044\u3066\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001URL\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5236\u7d04\u3092\u8a2d\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-65\">\u57fa\u672c\u7684\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u5236\u7d04<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306a\u30eb\u30fc\u30c8\u5b9a\u7fa9\uff08\u5236\u7d04\u306a\u3057\uff09\nRoute::get('\/user\/{id}', 'UserController@show');\n\n\/\/ \u6570\u5b57\u306e\u307f\u306e\u5236\u7d04\u3092\u8ffd\u52a0\nRoute::get('\/user\/{id}', 'UserController@show')-&gt;where('id', '[0-9]+');\n\n\/\/ \u8907\u6570\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5236\u7d04\u3092\u8ffd\u52a0\nRoute::get('\/user\/{id}\/{slug}', 'UserController@showPost')\n    -&gt;where([\n        'id' =&gt; '[0-9]+',\n        'slug' =&gt; '[a-z0-9-]+'\n    ]);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-66\">\u4fbf\u5229\u306a\u30b7\u30e7\u30fc\u30c8\u30cf\u30f3\u30c9\u30e1\u30bd\u30c3\u30c9\uff08Laravel 8\u4ee5\u964d\uff09<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6570\u5024\u306e\u307f\nRoute::get('\/user\/{id}', 'UserController@show')-&gt;whereNumber('id');\n\n\/\/ \u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u306e\u307f\nRoute::get('\/category\/{name}', 'CategoryController@show')-&gt;whereAlpha('name');\n\n\/\/ \u82f1\u6570\u5b57\u306e\u307f\nRoute::get('\/post\/{slug}', 'PostController@show')-&gt;whereAlphaNumeric('slug');\n\n\/\/ \u6307\u5b9a\u5024\u306e\u3044\u305a\u308c\u304b\nRoute::get('\/filter\/{type}', 'ProductController@filter')\n    -&gt;whereIn('type', ['new', 'sale', 'featured']);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-67\">\u30b0\u30ed\u30fc\u30d0\u30eb\u30d1\u30bf\u30fc\u30f3\u5236\u7d04<\/h4>\n\n\n\n<p>\u7279\u5b9a\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5168\u4f53\u3067\u540c\u3058\u5236\u7d04\u3092\u9069\u7528\u3059\u308b\u5834\u5408\u306f\u3001<code>RouteServiceProvider<\/code>\u306e<code>boot<\/code>\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u5b9a\u7fa9\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Providers\/RouteServiceProvider.php\npublic function boot()\n{\n    Route::pattern('id', '[0-9]+');\n    Route::pattern('slug', '[a-z0-9-]+');\n    \n    parent::boot();\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-68\">\u5b9f\u7528\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u4f8b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ UUID\u30de\u30c3\u30c1\u30f3\u30b0\nRoute::get('\/order\/{uuid}', 'OrderController@show')\n    -&gt;where('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');\n\n\/\/ \u65e5\u4ed8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 (YYYY-MM-DD)\nRoute::get('\/events\/{date}', 'EventController@byDate')\n    -&gt;where('date', '[0-9]{4}-[0-9]{2}-[0-9]{2}');\n\n\/\/ \u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf\u4ed8\u304d\u30eb\u30fc\u30c8\nRoute::get('\/articles\/{category}\/{year?}\/{month?}', 'ArticleController@index')\n    -&gt;where([\n        'category' =&gt; '[a-z-]+',\n        'year' =&gt; '[0-9]{4}',\n        'month' =&gt; '[0-9]{1,2}'\n    ]);\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5236\u7d04\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4e0d\u6b63\u306aURL\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u65e9\u671f\u306b\u6392\u9664\u3067\u304d\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u5185\u3067\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u7c21\u7d20\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-69\">Symfony\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3068\u6b63\u898f\u8868\u73fe\u306e\u9023\u643a<\/h3>\n\n\n\n<p>Symfony\u3067\u306f\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3068\u6b63\u898f\u8868\u73fe\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u3092\u52b9\u7387\u7684\u306b\u884c\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-70\">\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u305f\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Symfony\\Component\\Validator\\Constraints as Assert;\n\nclass User\n{\n    \/**\n     * @Assert\\NotBlank()\n     * @Assert\\Regex(\n     *     pattern=\"\/^[A-Z][a-zA-Z0-9]*$\/\",\n     *     message=\"\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u5927\u6587\u5b57\u3067\u59cb\u307e\u308a\u3001\u82f1\u6570\u5b57\u306e\u307f\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\"\n     * )\n     *\/\n    private $username;\n    \n    \/**\n     * @Assert\\Regex(\n     *     pattern=\"\/^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d).{8,}$\/\",\n     *     message=\"\u30d1\u30b9\u30ef\u30fc\u30c9\u306f8\u6587\u5b57\u4ee5\u4e0a\u3067\u3001\u5927\u6587\u5b57\u3001\u5c0f\u6587\u5b57\u3001\u6570\u5b57\u3092\u542b\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\"\n     * )\n     *\/\n    private $password;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-71\">FormType\u3067\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Symfony\\Component\\Form\\AbstractType;\nuse Symfony\\Component\\Form\\FormBuilderInterface;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType;\nuse Symfony\\Component\\Validator\\Constraints\\Regex;\n\nclass UserType extends AbstractType\n{\n    public function buildForm(FormBuilderInterface $builder, array $options)\n    {\n        $builder\n            -&gt;add('username', TextType::class, [\n                'constraints' =&gt; [\n                    new Regex([\n                        'pattern' =&gt; '\/^[A-Z][a-zA-Z0-9]*$\/',\n                        'message' =&gt; '\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u5927\u6587\u5b57\u3067\u59cb\u307e\u308a\u3001\u82f1\u6570\u5b57\u306e\u307f\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059'\n                    ])\n                ]\n            ])\n            -&gt;add('email', EmailType::class, [\n                'constraints' =&gt; [\n                    new Regex([\n                        'pattern' =&gt; '\/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$\/',\n                        'message' =&gt; '\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'\n                    ])\n                ]\n            ]);\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-72\">NotRegex\u5236\u7d04\u306e\u4f7f\u7528<\/h4>\n\n\n\n<p>\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Symfony\\Component\\Validator\\Constraints as Assert;\n\nclass Article\n{\n    \/**\n     * @Assert\\NotRegex(\n     *     pattern=\"\/^(password|admin|root)$\/i\",\n     *     message=\"\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u304b\u3089\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\"\n     * )\n     *\/\n    private $username;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-73\">HTML5\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3068\u306e\u9023\u643a<\/h4>\n\n\n\n<p>Symfony 4.0\u4ee5\u964d\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u5236\u7d04\u304b\u3089HTML5\u306e<code>pattern<\/code>\u5c5e\u6027\u3092\u81ea\u52d5\u751f\u6210\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Symfony\\Component\\Validator\\Constraints\\Regex;\n\n$constraint = new Regex([\n    'pattern' =&gt; '\/^[A-Z][a-zA-Z0-9]*$\/',\n    'htmlPattern' =&gt; '^[A-Z][a-zA-Z0-9]*$' \/\/ \u30b9\u30e9\u30c3\u30b7\u30e5\u306a\u3057\u306e\u30d1\u30bf\u30fc\u30f3\n]);\n\n\/\/ \u307e\u305f\u306f\u81ea\u52d5\u751f\u6210\u3059\u308b\u5834\u5408\n$htmlPattern = $constraint-&gt;getHtmlPattern(); \/\/ '^[A-Z][a-zA-Z0-9]*$'\n<\/pre>\n\n\n\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u306e\u4e21\u65b9\u3067\u4e00\u8cab\u3057\u305f\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-74\">WordPress\u30d7\u30e9\u30b0\u30a4\u30f3\u958b\u767a\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u5fdc\u7528<\/h3>\n\n\n\n<p>WordPress\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u958b\u767a\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u64cd\u4f5c\u3084\u62e1\u5f35\u6a5f\u80fd\u306e\u5b9f\u88c5\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-75\">\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u62e1\u5f35<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function highlight_shortcode($atts, $content = null) {\n    \/\/ [highlight]...[\/highlight]\u5185\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\u8868\u793a\n    return '&lt;div class=\"highlight\"&gt;' . $content . '&lt;\/div&gt;';\n}\nadd_shortcode('highlight', 'highlight_shortcode');\n\nfunction custom_shortcodes($content) {\n    \/\/ \u30ab\u30b9\u30bf\u30e0\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u51e6\u7406 [code lang=\"php\"]...[\/code]\n    $pattern = '\/\\[code(?:\\s+lang=[\"\\']([^\"\\']*)[\"\\'])?\\](.*?)\\[\\\/code\\]\/s';\n    \n    return preg_replace_callback($pattern, function($matches) {\n        $lang = isset($matches[1]) ? $matches[1] : 'text';\n        $code = htmlspecialchars($matches[2]);\n        return '&lt;pre class=\"language-' . $lang . '\"&gt;&lt;code&gt;' . $code . '&lt;\/code&gt;&lt;\/pre&gt;';\n    }, $content);\n}\nadd_filter('the_content', 'custom_shortcodes');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-76\">\u30b3\u30f3\u30c6\u30f3\u30c4\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/h4>\n\n\n\n<p>\u6295\u7a3f\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u81ea\u52d5\u7684\u306b\u5909\u63db\u3084\u6574\u5f62\u3092\u9069\u7528\u3059\u308b\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function auto_link_content($content) {\n    \/\/ URL\u3092\u30ea\u30f3\u30af\u306b\u81ea\u52d5\u5909\u63db\n    $pattern = '\/\\b(https?:\\\/\\\/[a-z0-9-]+(\\.[a-z0-9-]+)+(\\\/[^\\s]*)?)\/i';\n    $replacement = '&lt;a href=\"$1\" target=\"_blank\"&gt;$1&lt;\/a&gt;';\n    $content = preg_replace($pattern, $replacement, $content);\n    \n    \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u30ea\u30f3\u30af\u306b\u5909\u63db\uff08\u30b9\u30d1\u30e0\u5bfe\u7b56\u306e\u305f\u3081\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\uff09\n    $pattern = '\/\\b([A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,})\\b\/i';\n    $replacement = '&lt;a href=\"mailto:$1\"&gt;$1&lt;\/a&gt;';\n    $content = preg_replace($pattern, $replacement, $content);\n    \n    return $content;\n}\nadd_filter('the_content', 'auto_link_content');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-77\">\u30c6\u30ad\u30b9\u30c8\u7f6e\u63db\u30d5\u30a3\u30eb\u30bf\u30fc<\/h4>\n\n\n\n<p>\u7279\u5b9a\u306e\u30d5\u30ec\u30fc\u30ba\u3084\u7565\u8a9e\u3092\u81ea\u52d5\u7684\u306b\u62e1\u5f35\u307e\u305f\u306f\u4fee\u6b63\u3059\u308b\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function expand_abbreviations($content) {\n    $patterns = [\n        '\/\\b(WP)\\b\/' =&gt; '&lt;abbr title=\"WordPress\"&gt;WP&lt;\/abbr&gt;',\n        '\/\\b(PHP)\\b\/' =&gt; '&lt;abbr title=\"PHP: Hypertext Preprocessor\"&gt;PHP&lt;\/abbr&gt;',\n        '\/\\b(HTML)\\b\/' =&gt; '&lt;abbr title=\"HyperText Markup Language\"&gt;HTML&lt;\/abbr&gt;',\n        '\/\\b(CSS)\\b\/' =&gt; '&lt;abbr title=\"Cascading Style Sheets\"&gt;CSS&lt;\/abbr&gt;'\n    ];\n    \n    return preg_replace(array_keys($patterns), array_values($patterns), $content);\n}\nadd_filter('the_content', 'expand_abbreviations');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-78\">\u30ab\u30b9\u30bf\u30e0\u30ea\u30e9\u30a4\u30c8\u30eb\u30fc\u30eb\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30ab\u30b9\u30bf\u30e0\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u69cb\u9020\u306e\u8ffd\u52a0\nfunction custom_rewrite_rules() {\n    add_rewrite_rule(\n        'archive\/([0-9]{4})\/([0-9]{2})\/?,\n        'index.php?year=$matches[1]&amp;monthnum=$matches[2]',\n        'top'\n    );\n}\nadd_action('init', 'custom_rewrite_rules');\n\n\/\/ \u30ab\u30b9\u30bf\u30e0\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u306e\u51e6\u7406\nfunction modify_permalink($permalink, $post) {\n    if ($post-&gt;post_type !== 'product') {\n        return $permalink;\n    }\n    \n    \/\/ \u88fd\u54c1\u30ab\u30c6\u30b4\u30ea\u3092URL\u306b\u542b\u3081\u308b\n    $category = wp_get_post_terms($post-&gt;ID, 'product_category');\n    if (!empty($category)) {\n        $cat_slug = $category[0]-&gt;slug;\n        $permalink = preg_replace('\/\\\/product\\\/\/', '\/product\/' . $cat_slug . '\/', $permalink);\n    }\n    \n    return $permalink;\n}\nadd_filter('post_type_link', 'modify_permalink', 10, 2);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-79\">\u30e1\u30bf\u30c7\u30fc\u30bf\u304b\u3089\u306e\u60c5\u5831\u62bd\u51fa<\/h4>\n\n\n\n<p>\u6295\u7a3f\u30e1\u30bf\u30c7\u30fc\u30bf\u304b\u3089\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u60c5\u5831\u3092\u62bd\u51fa\u3059\u308b\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function extract_video_id($content) {\n    \/\/ YouTube\u306eURL\u304b\u3089\u30d3\u30c7\u30aaID\u3092\u62bd\u51fa\n    $pattern = '\/(?:youtube\\.com\\\/(?:[^\\\/\\n\\s]+\\\/\\S+\\\/|(?:v|e(?:mbed)?)\\\/|\\S*?[?&amp;]v=)|youtu\\.be\\\/)([a-zA-Z0-9_-]{11})\/';\n    \n    if (preg_match($pattern, $content, $matches)) {\n        return $matches[1]; \/\/ YouTube\u52d5\u753bID\n    }\n    \n    return false;\n}\n\nfunction display_video($content) {\n    $video_id = extract_video_id($content);\n    \n    if ($video_id) {\n        $video_embed = '&lt;div class=\"video-container\"&gt;&lt;iframe src=\"https:\/\/www.youtube.com\/embed\/' . $video_id . '\" frameborder=\"0\" allowfullscreen&gt;&lt;\/iframe&gt;&lt;\/div&gt;';\n        $content = $video_embed . $content;\n    }\n    \n    return $content;\n}\nadd_filter('the_content', 'display_video');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-80\">\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u30b5\u30cb\u30bf\u30a4\u30ba\u3059\u308b\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function validate_custom_field($input) {\n    \/\/ \u8a31\u53ef\u3055\u308c\u308b\u6587\u5b57\u306e\u307f\u3092\u542b\u3080\u304b\u30c1\u30a7\u30c3\u30af\n    if (!preg_match('\/^[a-zA-Z0-9_\\-\\s]+$\/', $input)) {\n        add_settings_error(\n            'my_plugin_options',\n            'invalid_field',\n            '\u7121\u52b9\u306a\u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u82f1\u6570\u5b57\u3001\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u3001\u30cf\u30a4\u30d5\u30f3\u3001\u30b9\u30da\u30fc\u30b9\u306e\u307f\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002'\n        );\n        \/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u307e\u305f\u306f\u7a7a\u6587\u5b57\u3092\u8fd4\u3059\n        return '';\n    }\n    \n    return $input;\n}\n\n\/\/ \u30aa\u30d7\u30b7\u30e7\u30f3\u5024\u306e\u30b5\u30cb\u30bf\u30a4\u30ba\u30d5\u30c3\u30af\u306b\u767b\u9332\nadd_filter('sanitize_option_my_plugin_field', 'validate_custom_field');\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u4f8b\u306f\u3001WordPress\u958b\u767a\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u5b9f\u7528\u7684\u306a\u6d3b\u7528\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3084\u30c6\u30fc\u30de\u306e\u6a5f\u80fd\u3092\u52b9\u7387\u7684\u306b\u62e1\u5f35\u3067\u304d\u3001\u3088\u308a\u30d1\u30ef\u30d5\u30eb\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5404\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084CMS\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u6d3b\u7528\u65b9\u6cd5\u304c\u3055\u3089\u306b\u9032\u5316\u3057\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3057\u3066\u3001\u6700\u65b0\u306e\u6a5f\u80fd\u3084\u63a8\u5968\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-81\">\u3088\u304f\u3042\u308bPHP\u6b63\u898f\u8868\u73fe\u306e\u30c8\u30e9\u30d6\u30eb\u3068\u89e3\u6c7a\u6cd5<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u3067\u3059\u304c\u3001\u6642\u306b\u4e88\u671f\u305b\u306c\u52d5\u4f5c\u306b\u60a9\u307e\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001PHP\u958b\u767a\u8005\u304c\u3088\u304f\u906d\u9047\u3059\u308b\u6b63\u898f\u8868\u73fe\u306e\u30c8\u30e9\u30d6\u30eb\u3068\u305d\u306e\u89e3\u6c7a\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u77e5\u8b58\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3057\u3001\u3088\u308a\u5805\u7262\u306a\u30b3\u30fc\u30c9\u306e\u4f5c\u6210\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-82\">\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u30bb\u30c3\u30c8\u3067\u306e\u6b63\u898f\u8868\u73fe\u306e\u7f60\u3068\u5bfe\u7b56<\/h3>\n\n\n\n<p>\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6b63\u898f\u8868\u73fe\u3067\u6271\u3046\u969b\u306b\u306f\u3001\u7279\u6709\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-83\">\u4e3b\u306a\u554f\u984c\u70b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6587\u5b57\u5316\u3051<\/strong>: \u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u304c\u6b63\u3057\u304f\u8a8d\u8b58\u3055\u308c\u305a\u3001\u4e0d\u6b63\u306a\u7d50\u679c\u304c\u8fd4\u3055\u308c\u308b<\/li>\n\n\n\n<li><strong>\u4f4d\u7f6e\u305a\u308c<\/strong>: \u30d0\u30a4\u30c8\u6570\u3068\u6587\u5b57\u6570\u306e\u9055\u3044\u306b\u3088\u308a\u3001\u4f4d\u7f6e\u6307\u5b9a\u304c\u6b63\u3057\u304f\u6a5f\u80fd\u3057\u306a\u3044<\/li>\n\n\n\n<li><strong>\u30de\u30c3\u30c1\u30f3\u30b0\u5931\u6557<\/strong>: \u6587\u5b57\u30af\u30e9\u30b9\u304c\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5bfe\u3057\u3066\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u306a\u3044<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-84\">\u5bfe\u7b56\u3068\u89e3\u6c7a\u6cd5<\/h4>\n\n\n\n<p><strong>1. u\u4fee\u98fe\u5b50\u306e\u4f7f\u7528\uff08\u6700\u91cd\u8981\uff09<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\uff09\nif (preg_match('\/[\u3042-\u3093]+\/', $japanese_text)) {\n    \/\/ \u51e6\u7406\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08u\u4fee\u98fe\u5b50\u3067UTF-8\u30e2\u30fc\u30c9\u3092\u6709\u52b9\u5316\uff09\nif (preg_match('\/[\u3042-\u3093]+\/u', $japanese_text)) {\n    \/\/ \u51e6\u7406\n}\n<\/pre>\n\n\n\n<p><code>u<\/code>\u4fee\u98fe\u5b50\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u3068\u5bfe\u8c61\u6587\u5b57\u5217\u3092UTF-8\u3068\u3057\u3066\u51e6\u7406\u3059\u308b\u3088\u3046PCRE\u30a8\u30f3\u30b8\u30f3\u306b\u6307\u793a\u3057\u307e\u3059\u3002\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u5834\u5408\u306f<strong>\u5fc5\u305a<\/strong>\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>2. Unicode\u5bfe\u5fdc\u306e\u6587\u5b57\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u3088\u308a\u5805\u7262\u306a\u65b9\u6cd5\uff08Unicode\u6587\u5b57\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u7528\uff09\n$patterns = [\n    '\u3072\u3089\u304c\u306a' =&gt; '\/\\p{Hiragana}+\/u',\n    '\u30ab\u30bf\u30ab\u30ca' =&gt; '\/\\p{Katakana}+\/u',\n    '\u6f22\u5b57' =&gt; '\/\\p{Han}+\/u',\n    '\u65e5\u672c\u8a9e\u5168\u822c' =&gt; '\/[\\p{Hiragana}\\p{Katakana}\\p{Han}]+\/u'\n];\n\nif (preg_match($patterns['\u3072\u3089\u304c\u306a'], $text, $matches)) {\n    echo \"\u3072\u3089\u304c\u306a: \" . $matches[0];\n}\n<\/pre>\n\n\n\n<p><strong>3. \u6587\u5b57\u6570\u3068\u4f4d\u7f6e\u306e\u6b63\u3057\u3044\u51e6\u7406<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d0\u30a4\u30c8\u4f4d\u7f6e\u3067\u306f\u306a\u304f\u6587\u5b57\u4f4d\u7f6e\u3067\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u5de5\u592b\nfunction mb_preg_match_pos($pattern, $subject, &amp;$matches, $offset = 0) {\n    \/\/ \u6587\u5b57\u4f4d\u7f6e\u304b\u3089\u30d0\u30a4\u30c8\u4f4d\u7f6e\u3078\u306e\u5909\u63db\n    $byte_offset = $offset ? mb_strlen(mb_substr($subject, 0, $offset, 'UTF-8'), '8bit') : 0;\n    \n    if (preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, $byte_offset)) {\n        \/\/ \u30d0\u30a4\u30c8\u4f4d\u7f6e\u304b\u3089\u6587\u5b57\u4f4d\u7f6e\u3078\u306e\u5909\u63db\n        foreach ($matches as &amp;$match) {\n            $match[1] = mb_strlen(mb_substr($subject, 0, $match[1], '8bit'), 'UTF-8');\n        }\n        return true;\n    }\n    return false;\n}\n<\/pre>\n\n\n\n<p><strong>4. \u30d5\u30a1\u30a4\u30eb\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u7d71\u4e00<\/strong><\/p>\n\n\n\n<p>PHP\u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304cUTF-8\u3067\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3001\u304a\u3088\u3073 <code>default_charset<\/code> \u8a2d\u5b9a\u304cUTF-8\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\u3067\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u660e\u793a\nmb_internal_encoding('UTF-8');\nmb_http_output('UTF-8');\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-85\">\u30c7\u30d0\u30c3\u30b0\u304c\u96e3\u3057\u3044\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/h3>\n\n\n\n<p>\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u306e\u30c7\u30d0\u30c3\u30b0\u306f\u56f0\u96e3\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u624b\u6cd5\u3067\u52b9\u7387\u7684\u306b\u30c8\u30e9\u30d6\u30eb\u3092\u89e3\u6c7a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-86\">\u6bb5\u968e\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u30a2\u30d7\u30ed\u30fc\u30c1<\/h4>\n\n\n\n<p><strong>1. \u30d1\u30bf\u30fc\u30f3\u3092\u5206\u89e3\u3057\u3066\u30c6\u30b9\u30c8\u3059\u308b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\n$complex = '\/^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[^\\w\\d\\s]).{8,}$\/';\n\n\/\/ \u5206\u89e3\u3057\u3066\u30c6\u30b9\u30c8\n$tests = [\n    '\u5927\u6587\u5b57\u542b\u3080' =&gt; '\/[A-Z]\/',\n    '\u5c0f\u6587\u5b57\u542b\u3080' =&gt; '\/[a-z]\/',\n    '\u6570\u5b57\u542b\u3080' =&gt; '\/\\d\/',\n    '\u7279\u6b8a\u6587\u5b57\u542b\u3080' =&gt; '\/[^\\w\\d\\s]\/',\n    '8\u6587\u5b57\u4ee5\u4e0a' =&gt; '\/.{8,}\/'\n];\n\nforeach ($tests as $desc =&gt; $pattern) {\n    echo \"$desc: \" . (preg_match($pattern, $password) ? \"OK\" : \"NG\") . \"\\n\";\n}\n<\/pre>\n\n\n\n<p><strong>2. \u30a8\u30e9\u30fc\u5185\u5bb9\u3092\u8a73\u7d30\u306b\u78ba\u8a8d\u3059\u308b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function debug_regex($pattern, $subject) {\n    $result = preg_match($pattern, $subject, $matches);\n    echo \"\u30d1\u30bf\u30fc\u30f3: $pattern\\n\";\n    echo \"\u5bfe\u8c61\u6587\u5b57\u5217: $subject\\n\";\n    \n    if ($result === false) {\n        $error_code = preg_last_error();\n        $error_messages = [\n            PREG_NO_ERROR =&gt; '\u30a8\u30e9\u30fc\u306a\u3057',\n            PREG_INTERNAL_ERROR =&gt; '\u5185\u90e8PCRE\u30a8\u30e9\u30fc',\n            PREG_BACKTRACK_LIMIT_ERROR =&gt; '\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u5236\u9650\u8d85\u904e',\n            PREG_RECURSION_LIMIT_ERROR =&gt; '\u518d\u5e30\u5236\u9650\u8d85\u904e',\n            PREG_BAD_UTF8_ERROR =&gt; '\u4e0d\u6b63\u306aUTF-8\u30c7\u30fc\u30bf',\n            PREG_BAD_UTF8_OFFSET_ERROR =&gt; '\u4e0d\u6b63\u306aUTF-8\u30aa\u30d5\u30bb\u30c3\u30c8'\n        ];\n        \n        if (defined('PREG_JIT_STACKLIMIT_ERROR')) {\n            $error_messages[PREG_JIT_STACKLIMIT_ERROR] = 'JIT\u30b9\u30bf\u30c3\u30af\u5236\u9650\u8d85\u904e';\n        }\n        \n        echo \"\u30a8\u30e9\u30fc: \" . ($error_messages[$error_code] ?? '\u4e0d\u660e\u306a\u30a8\u30e9\u30fc') . \"\\n\";\n        return false;\n    }\n    \n    echo \"\u7d50\u679c: \" . ($result ? \"\u30de\u30c3\u30c1\u3042\u308a\\n\" : \"\u30de\u30c3\u30c1\u306a\u3057\\n\");\n    if ($result &amp;&amp; !empty($matches)) {\n        echo \"\u30de\u30c3\u30c1\u5185\u5bb9:\\n\";\n        print_r($matches);\n    }\n    \n    return $result;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ndebug_regex('\/\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\/', $test_string);\n<\/pre>\n\n\n\n<p><strong>3. \u53ef\u8996\u5316\u3068\u6ce8\u91c8\u4ed8\u304d\u30d1\u30bf\u30fc\u30f3<\/strong><\/p>\n\n\n\n<p><code>x<\/code>\u4fee\u98fe\u5b50\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30d1\u30bf\u30fc\u30f3\u5185\u3067\u7a7a\u767d\u3084\u30b3\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306e\u53ef\u8aad\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u901a\u5e38\u306e\u6b63\u898f\u8868\u73fe\n$pattern = '\/^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[^\\w\\d\\s]).{8,}$\/';\n\n\/\/ x\u30e2\u30fc\u30c9\u3067\u306e\u540c\u3058\u30d1\u30bf\u30fc\u30f3\uff08\u53ef\u8aad\u6027\u5411\u4e0a\uff09\n$pattern_readable = '\/\n    ^               # \u884c\u306e\u5148\u982d\n    (?=.*[A-Z])     # \u5c11\u306a\u304f\u3068\u30821\u3064\u306e\u5927\u6587\u5b57\u3092\u542b\u3080\n    (?=.*[a-z])     # \u5c11\u306a\u304f\u3068\u30821\u3064\u306e\u5c0f\u6587\u5b57\u3092\u542b\u3080\n    (?=.*\\d)        # \u5c11\u306a\u304f\u3068\u30821\u3064\u306e\u6570\u5b57\u3092\u542b\u3080\n    (?=.*[^\\w\\d\\s]) # \u5c11\u306a\u304f\u3068\u30821\u3064\u306e\u7279\u6b8a\u6587\u5b57\u3092\u542b\u3080\n    .{8,}           # \u5168\u4f53\u30678\u6587\u5b57\u4ee5\u4e0a\n    $               # \u884c\u306e\u672b\u5c3e\n\/x';\n<\/pre>\n\n\n\n<p><strong>4. \u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u306e\u6d3b\u7528<\/strong><\/p>\n\n\n\n<p>\u8907\u96d1\u306a\u30c7\u30d0\u30c3\u30b0\u306b\u306f\u3001<a href=\"https:\/\/regex101.com\/\">Regex101<\/a>\uff08PCRE\u30e2\u30fc\u30c9\u3092\u9078\u629e\uff09\u3084<a href=\"https:\/\/www.phpliveregex.com\/\">PHPLiveRegex<\/a>\u306a\u3069\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u304c\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u30c4\u30fc\u30eb\u3067\u306f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6b63\u898f\u8868\u73fe\u3092\u8996\u899a\u7684\u306b\u5206\u89e3\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3067\u304d\u308b<\/li>\n\n\n\n<li>\u30de\u30c3\u30c1\u30f3\u30b0\u306e\u5404\u30b9\u30c6\u30c3\u30d7\u3092\u78ba\u8a8d\u3067\u304d\u308b<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u3084\u8b66\u544a\u3092\u8868\u793a\u3057\u3066\u304f\u308c\u308b<\/li>\n\n\n\n<li>\u30c6\u30b9\u30c8\u6587\u5b57\u5217\u3092\u5909\u66f4\u3057\u3066\u5373\u6642\u306b\u7d50\u679c\u3092\u78ba\u8a8d\u3067\u304d\u308b<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-87\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c8\u30e9\u30d6\u30eb\u306e\u7279\u5b9a<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u304c\u6975\u7aef\u306b\u9045\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u539f\u56e0\u3092\u7591\u3044\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u904e\u5ea6\u306e\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u91cf\u6307\u5b9a\u5b50(<code>*<\/code>, <code>+<\/code>, <code>{n,m}<\/code>)\u3068\u9078\u629e\u80a2\u304c\u7d44\u307f\u5408\u308f\u3055\u3063\u3066\u3044\u308b<\/li>\n\n\n\n<li>\u5165\u308c\u5b50\u306b\u306a\u3063\u305f\u7e70\u308a\u8fd4\u3057(\u4f8b:<code>(a+)+<\/code>)\u304c\u3042\u308b<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u904e\u5270\u306b\u6b32\u5f35\u308a\u306a\u30d1\u30bf\u30fc\u30f3<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u6c4e\u7528\u7684\u3059\u304e\u308b\u30d1\u30bf\u30fc\u30f3(\u4f8b:<code>.*.*<\/code>)<\/li>\n\n\n\n<li>\u904e\u5ea6\u306b\u8907\u96d1\u306a\u30cd\u30b9\u30c8\u69cb\u9020<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6e2c\u5b9a\u95a2\u6570\nfunction measure_regex_performance($pattern, $subject, $iterations = 1) {\n    $start = microtime(true);\n    $result = null;\n    \n    for ($i = 0; $i &lt; $iterations; $i++) {\n        $result = preg_match($pattern, $subject, $matches);\n    }\n    \n    $end = microtime(true);\n    $time = ($end - $start) * 1000; \/\/ \u30df\u30ea\u79d2\u306b\u5909\u63db\n    \n    echo \"\u30d1\u30bf\u30fc\u30f3: $pattern\\n\";\n    echo \"\u51e6\u7406\u6642\u9593: \" . number_format($time, 2) . \" ms ($iterations \u56de\u5b9f\u884c)\\n\";\n    echo \"\u7d50\u679c: \" . ($result ? \"\u30de\u30c3\u30c1\u3042\u308a\" : ($result === 0 ? \"\u30de\u30c3\u30c1\u306a\u3057\" : \"\u30a8\u30e9\u30fc\")) . \"\\n\";\n    \n    return $time;\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-88\">\u74b0\u5883\u9593\u306e\u4e92\u63db\u6027\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308bPCRE\u8a2d\u5b9a\u306e\u8abf\u6574\u6cd5<\/h3>\n\n\n\n<p>PHP\u6b63\u898f\u8868\u73fe\u306fPCRE\uff08Perl\u4e92\u63db\u6b63\u898f\u8868\u73fe\uff09\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u4f9d\u5b58\u3057\u3066\u304a\u308a\u3001\u74b0\u5883\u3084\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u52d5\u4f5c\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-89\">\u4e3b\u306a\u4e92\u63db\u6027\u554f\u984c<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>PCRE\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u9055\u3044<\/strong>\n<ul class=\"wp-block-list\">\n<li>PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u4f7f\u7528\u3055\u308c\u308bPCRE\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308b<\/li>\n\n\n\n<li>PHP 7.3\u4ee5\u964d\u306fPCRE2\u3092\u4f7f\u7528\u3057\u3001\u305d\u308c\u4ee5\u524d\u306fPCRE1\u3092\u4f7f\u7528<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u8a2d\u5b9a\u306e\u9055\u3044<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u74b0\u5883\u306b\u3088\u3063\u3066\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u304c\u7570\u306a\u308b<\/li>\n\n\n\n<li>\u7279\u306b\u5236\u9650\u5024\uff08backtrack_limit\u3001recursion_limit\uff09\u306e\u5dee<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-90\">\u8a2d\u5b9a\u8abf\u6574\u306b\u3088\u308b\u89e3\u6c7a<\/h4>\n\n\n\n<p><strong>1. PCRE\u5236\u9650\u306e\u8abf\u6574<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u73fe\u5728\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\n$current_limits = [\n    'backtrack_limit' =&gt; ini_get('pcre.backtrack_limit'),\n    'recursion_limit' =&gt; ini_get('pcre.recursion_limit')\n];\necho \"\u73fe\u5728\u306e\u8a2d\u5b9a: \" . json_encode($current_limits) . \"\\n\";\n\n\/\/ \u51e6\u7406\u524d\u306b\u5236\u9650\u3092\u4e00\u6642\u7684\u306b\u7de9\u548c\n$old_backtrack_limit = ini_get('pcre.backtrack_limit');\nini_set('pcre.backtrack_limit', '2000000');\n\n\/\/ \u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u5b9f\u884c\n$result = preg_match($complex_pattern, $large_text);\n\n\/\/ \u8a2d\u5b9a\u3092\u5143\u306b\u623b\u3059\nini_set('pcre.backtrack_limit', $old_backtrack_limit);\n<\/pre>\n\n\n\n<p><strong>2. \u74b0\u5883\u691c\u51fa\u3068\u5bfe\u5fdc<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u74b0\u5883\u306b\u5fdc\u3058\u305f\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306e\u8abf\u6574\nfunction get_compatible_pattern($pattern) {\n    $pcre_version = preg_replace('\/^PCRE ([\\d.]+) .*$\/', '$1', PCRE_VERSION);\n    \n    if (version_compare($pcre_version, '8.0.0', '&gt;=')) {\n        \/\/ PCRE2\u307e\u305f\u306fPCRE 8.0\u4ee5\u964d\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\n        return $pattern;\n    } else {\n        \/\/ \u53e4\u3044PCRE\u30d0\u30fc\u30b8\u30e7\u30f3\u7528\u306b\u4e92\u63db\u30d1\u30bf\u30fc\u30f3\u3092\u8fd4\u3059\n        \/\/ \u4f8b: \\R\u3092\\r?\\n\u306b\u7f6e\u304d\u63db\u3048\u308b\u306a\u3069\n        return str_replace('\\R', '(?:\\r\\n|\\r|\\n)', $pattern);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$pattern = get_compatible_pattern('\/^\\p{Hiragana}+\\R\\p{Katakana}+$\/u');\n<\/pre>\n\n\n\n<p><strong>3. \u4e92\u63db\u6027\u306e\u3042\u308b\u30e9\u30c3\u30d1\u30fc\u95a2\u6570\u306e\u4f5c\u6210<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u74b0\u5883\u306e\u9055\u3044\u3092\u5438\u53ce\u3059\u308b\u30e9\u30c3\u30d1\u30fc\u95a2\u6570\nfunction compat_preg_match($pattern, $subject, &amp;$matches = null, $flags = 0, $offset = 0) {\n    \/\/ \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u8a2d\u5b9a\u306e\u53d6\u5f97\n    $backtrack_limit = ini_get('pcre.backtrack_limit');\n    $recursion_limit = ini_get('pcre.recursion_limit');\n    \n    \/\/ \u4e00\u6642\u7684\u306b\u5236\u9650\u3092\u7de9\u548c\n    ini_set('pcre.backtrack_limit', max(1000000, (int)$backtrack_limit));\n    ini_set('pcre.recursion_limit', max(100000, (int)$recursion_limit));\n    \n    \/\/ \u30d1\u30bf\u30fc\u30f3\u306e\u74b0\u5883\u9069\u5fdc\u51e6\u7406\n    $pattern = adjust_pattern_for_environment($pattern);\n    \n    \/\/ \u5b9f\u884c\n    $result = preg_match($pattern, $subject, $matches, $flags, $offset);\n    \n    \/\/ \u5143\u306e\u8a2d\u5b9a\u306b\u623b\u3059\n    ini_set('pcre.backtrack_limit', $backtrack_limit);\n    ini_set('pcre.recursion_limit', $recursion_limit);\n    \n    return $result;\n}\n\n\/\/ \u74b0\u5883\u306b\u5fdc\u3058\u305f\u30d1\u30bf\u30fc\u30f3\u8abf\u6574\nfunction adjust_pattern_for_environment($pattern) {\n    \/\/ PHP\/PCRE\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5fdc\u3058\u305f\u8abf\u6574\n    if (version_compare(PHP_VERSION, '7.3.0', '&lt;')) {\n        \/\/ PHP 7.3\u672a\u6e80\u306e\u5834\u5408\u306e\u8abf\u6574\n        \/\/ \u4f8b: \\X, \\R \u306a\u3069\u306e\u4e00\u90e8\u306e\u6a5f\u80fd\u306b\u4e92\u63db\u6027\u8abf\u6574\u3092\u9069\u7528\n    }\n    return $pattern;\n}\n<\/pre>\n\n\n\n<p><strong>4. \u4e3b\u306aPCRE\u8a2d\u5b9a\u5024\u3068\u63a8\u5968\u5024<\/strong><\/p>\n\n\n<div id=\"id-a4433bfb-4c59-4c5f-aad4-26175c6f9ed7\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a2d\u5b9a\u9805\u76ee<\/th><th>\u8aac\u660e<\/th><th>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/th><th>\u63a8\u5968\u5024<\/th><\/tr><\/thead><tbody><tr><td>pcre.backtrack_limit<\/td><td>\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30af\u306e\u6700\u5927\u56de\u6570<\/td><td>1000000<\/td><td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5fdc\u3058\u3066\u8abf\u6574\uff08\u5927\u898f\u6a21\u51e6\u7406\u306a\u3089\u5897\u52a0\uff09<\/td><\/tr><tr><td>pcre.recursion_limit<\/td><td>\u518d\u5e30\u306e\u6700\u5927\u6df1\u3055<\/td><td>100000<\/td><td>\u8907\u96d1\u306a\u30cd\u30b9\u30c8\u30d1\u30bf\u30fc\u30f3\u306a\u3089\u5897\u52a0<\/td><\/tr><tr><td>pcre.jit<\/td><td>JIT\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u6709\u52b9\/\u7121\u52b9<\/td><td>1 (On)<\/td><td>\u901a\u5e38\u306f\u30aa\u30f3\u3001\u554f\u984c\u304c\u3042\u308b\u5834\u5408\u306e\u307f\u30aa\u30d5\u306b<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>PCRE\u8a2d\u5b9a\u306e\u8abf\u6574\u306f\u3001php.ini\u30d5\u30a1\u30a4\u30eb\u3067\u6052\u4e45\u7684\u306b\u884c\u3046\u304b\u3001<code>ini_set()<\/code>\u95a2\u6570\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u3067\u4e00\u6642\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30c6\u30b9\u30c8\u74b0\u5883\u3068\u672c\u756a\u74b0\u5883\u3067\u540c\u3058\u8a2d\u5b9a\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4e88\u671f\u305b\u306c\u52d5\u4f5c\u306e\u9055\u3044\u3092\u9632\u6b62\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u6280\u8853\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u6b63\u898f\u8868\u73fe\u306b\u95a2\u3059\u308b\u554f\u984c\u306e\u591a\u304f\u3092\u52b9\u7387\u7684\u306b\u89e3\u6c7a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u7279\u306b\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u5834\u5408\u306f\u5e38\u306b<code>u<\/code>\u4fee\u98fe\u5b50\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u7fd2\u6163\u3065\u3051\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u6bb5\u968e\u7684\u306b\u69cb\u7bc9\u30fb\u30c6\u30b9\u30c8\u3059\u308b\u3053\u3068\u3092\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-91\">PHP\u6b63\u898f\u8868\u73fe\u30b9\u30ad\u30eb\u3092\u6b21\u306e\u30ec\u30d9\u30eb\u306b\u4e0a\u3052\u308b\u305f\u3081\u306e\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u7fd2\u5f97\u306b\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u304c\u3001\u9069\u5207\u306a\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u52b9\u7387\u7684\u306b\u30b9\u30ad\u30eb\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001PHP\u6b63\u898f\u8868\u73fe\u306e\u30b9\u30ad\u30eb\u3092\u78e8\u304f\u305f\u3081\u306e\u66f8\u7c4d\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9\u3001\u7df4\u7fd2\u554f\u984c\u3001\u305d\u3057\u3066\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30ea\u30bd\u30fc\u30b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-92\">\u63a8\u5968\u66f8\u7c4d\u3068\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9\u3067\u4f53\u7cfb\u7684\u306b\u5b66\u3076<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-93\">\u66f8\u7c4d<\/h4>\n\n\n\n<p><strong>\u82f1\u8a9e\u306e\u66f8\u7c4d<\/strong><\/p>\n\n\n<div id=\"id-8c5003c7-bf12-4583-98a9-5dafd265ff2e\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u66f8\u7c4d\u540d<\/th><th>\u8457\u8005<\/th><th>\u7279\u5fb4<\/th><th>\u5bfe\u8c61\u30ec\u30d9\u30eb<\/th><\/tr><\/thead><tbody><tr><td>Mastering Regular Expressions<\/td><td>Jeffrey E.F. Friedl<\/td><td>\u6b63\u898f\u8868\u73fe\u306b\u95a2\u3059\u308b\u6700\u3082\u5305\u62ec\u7684\u306a\u672c\u3002\u57fa\u790e\u304b\u3089\u9ad8\u5ea6\u306a\u30c6\u30af\u30cb\u30c3\u30af\u307e\u3067\u7db2\u7f85<\/td><td>\u521d\u7d1a\uff5e\u4e0a\u7d1a<\/td><\/tr><tr><td>Regular Expressions Cookbook<\/td><td>Jan Goyvaerts &amp; Steven Levithan<\/td><td>\u5b9f\u7528\u7684\u306a\u30ec\u30b7\u30d4\u5f62\u5f0f\u3067\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u5b66\u3079\u308b<\/td><td>\u4e2d\u7d1a\uff5e\u4e0a\u7d1a<\/td><\/tr><tr><td>PHP Master: Write Cutting-Edge Code<\/td><td>Lorna Mitchell, et al.<\/td><td>PHP\u306e\u9ad8\u5ea6\u306a\u30c8\u30d4\u30c3\u30af\u3092\u6271\u3044\u3001\u6b63\u898f\u8868\u73fe\u306e\u7ae0\u3082\u5145\u5b9f<\/td><td>\u4e2d\u7d1a<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>\u65e5\u672c\u8a9e\u306e\u66f8\u7c4d<\/strong><\/p>\n\n\n<div id=\"id-25915b50-0181-4a7d-a9da-84801a7040fc\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u66f8\u7c4d\u540d<\/th><th>\u8457\u8005<\/th><th>\u7279\u5fb4<\/th><th>\u5bfe\u8c61\u30ec\u30d9\u30eb<\/th><\/tr><\/thead><tbody><tr><td>\u521d\u3081\u3066\u306e\u6b63\u898f\u8868\u73fe<\/td><td>Michael Fitzgerald (\u592a\u7530 \u826f\u5178 \u8a33)<\/td><td>\u6b63\u898f\u8868\u73fe\u306e\u57fa\u790e\u304b\u3089\u5b9f\u8df5\u307e\u3067\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/td><td>\u521d\u7d1a\uff5e\u4e2d\u7d1a<\/td><\/tr><tr><td>\u8a73\u8aac \u6b63\u898f\u8868\u73fe \u7b2c3\u7248<\/td><td>Jeffrey E.F. Friedl (\u9577\u5c3e \u9ad8\u5f18 \u8a33)<\/td><td>\u300cMastering Regular Expressions\u300d\u306e\u65e5\u672c\u8a9e\u8a33\u3002\u5b9a\u756a\u66f8\u7c4d<\/td><td>\u521d\u7d1a\uff5e\u4e0a\u7d1a<\/td><\/tr><tr><td>PHP\u672c\u683c\u5165\u9580 \u4e0b<\/td><td>\u5927\u5bb6 \u6b63\u767b, \u4e45\u4fdd\u7530 \u8ce2\u4e8c<\/td><td>\u5b9f\u8df5\u7684\u306aPHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3079\u308b\u3002\u6b63\u898f\u8868\u73fe\u306e\u7ae0\u304c\u5145\u5b9f<\/td><td>\u4e2d\u7d1a<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-94\">\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9<\/h4>\n\n\n<div id=\"id-127ae015-2ea9-44c4-bdfe-e33c2bf8fc1e\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b3\u30fc\u30b9\u540d<\/th><th>\u63d0\u4f9b\u5143<\/th><th>\u7279\u5fb4<\/th><th>\u5bfe\u8c61\u30ec\u30d9\u30eb<\/th><th>\u4fa1\u683c<\/th><\/tr><\/thead><tbody><tr><td>Regular Expressions for Beginners and Beyond! With PHP examples<\/td><td>Udemy<\/td><td>PHP\u3067\u306e\u6b63\u898f\u8868\u73fe\u4f7f\u7528\u306b\u7126\u70b9\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u304c\u8c4a\u5bcc<\/td><td>\u521d\u7d1a\uff5e\u4e2d\u7d1a<\/td><td>\u6709\u6599<\/td><\/tr><tr><td>Learn Regular Expressions in PHP<\/td><td>LinkedIn Learning<\/td><td>PHP\u306b\u304a\u3051\u308b\u6b63\u898f\u8868\u73fe\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u7db2\u7f85<\/td><td>\u521d\u7d1a\uff5e\u4e2d\u7d1a<\/td><td>\u6709\u6599<\/td><\/tr><tr><td>Regular Expressions in PHP<\/td><td>Laracasts<\/td><td>PHP\u3067\u306e\u6b63\u898f\u8868\u73fe\u306e\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9\u306b\u7126\u70b9<\/td><td>\u4e2d\u7d1a<\/td><td>\u6709\u6599<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-95\">\u7121\u6599\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30ea\u30bd\u30fc\u30b9<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/book.pcre.php\">PHP Manual: Regular Expressions (PCRE)<\/a> \u2013 PHP\u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u6b63\u898f\u8868\u73fe\u90e8\u5206\u3002\u6700\u3082\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/li>\n\n\n\n<li><a href=\"https:\/\/www.regular-expressions.info\/\">Regular-Expressions.info<\/a> \u2013 \u6b63\u898f\u8868\u73fe\u306b\u95a2\u3059\u308b\u5305\u62ec\u7684\u306a\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/li>\n\n\n\n<li><a href=\"https:\/\/regexone.com\/\">RegexOne<\/a> \u2013 \u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u30ec\u30c3\u30b9\u30f3\u3067\u6b63\u898f\u8868\u73fe\u306e\u57fa\u790e\u3092\u5b66\u3079\u308b\u7121\u6599\u30b3\u30fc\u30b9<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-96\">\u5b9f\u8df5\u7684\u306a\u30b9\u30ad\u30eb\u3092\u78e8\u304f\u305f\u3081\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8ab2\u984c\u96c6<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-97\">\u30aa\u30f3\u30e9\u30a4\u30f3\u7df4\u7fd2\u30b5\u30a4\u30c8<\/h4>\n\n\n\n<p>\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u7df4\u7fd2\u3059\u308b\u3053\u3068\u304c\u3001\u6b63\u898f\u8868\u73fe\u30b9\u30ad\u30eb\u3092\u78e8\u304f\u6700\u3082\u52b9\u679c\u7684\u306a\u65b9\u6cd5\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3067\u306f\u3001\u697d\u3057\u307f\u306a\u304c\u3089\u6b63\u898f\u8868\u73fe\u306e\u30b9\u30ad\u30eb\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/regexcrossword.com\/\">RegexCrossword<\/a><\/strong> \u2013 \u30af\u30ed\u30b9\u30ef\u30fc\u30c9\u30d1\u30ba\u30eb\u5f62\u5f0f\u3067\u6b63\u898f\u8868\u73fe\u3092\u5b66\u3079\u308b\u30b2\u30fc\u30e0<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/alf.nu\/RegexGolf\">Regex Golf<\/a><\/strong> \u2013 \u6700\u77ed\u306e\u6b63\u898f\u8868\u73fe\u3092\u8003\u3048\u308b\u601d\u8003\u529b\u3092\u935b\u3048\u308b\u30b2\u30fc\u30e0<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.hackerrank.com\/domains\/regex\">HackerRank Regex Challenges<\/a><\/strong> \u2013 \u81ea\u52d5\u8a55\u4fa1\u30b7\u30b9\u30c6\u30e0\u3067\u5373\u6642\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u5f97\u3089\u308c\u308b\u554f\u984c\u96c6<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/github.com\/callumacrae\/regex-tuesday\">Regex Tuesday<\/a><\/strong> \u2013 \u6bb5\u968e\u7684\u306b\u96e3\u6613\u5ea6\u304c\u4e0a\u304c\u308b\u554f\u984c\u30bb\u30c3\u30c8<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-98\">\u5b9f\u8df5\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u8ab2\u984c<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u53d6\u308a\u7d44\u3080\u3053\u3068\u3067\u3001\u5b9f\u969b\u306e\u958b\u767a\u30b7\u30fc\u30f3\u3067\u5f79\u7acb\u3064\u30b9\u30ad\u30eb\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<p><strong>\u521d\u7d1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30d5\u30a9\u30fc\u30e0\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5b9f\u88c5<\/strong> \u2013 \u540d\u524d\u3001\u30e1\u30fc\u30eb\u3001\u96fb\u8a71\u756a\u53f7\u306a\u3069\u306e\u5165\u529b\u691c\u8a3c\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9<\/li>\n\n\n\n<li><strong>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u62bd\u51fa<\/strong> \u2013 \u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u62bd\u51fa\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4f5c\u6210<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e2d\u7d1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u89e3\u6790\u30c4\u30fc\u30eb<\/strong> \u2013 Apache\u3084PHP\u30a8\u30e9\u30fc\u30ed\u30b0\u304b\u3089\u7279\u5b9a\u30d1\u30bf\u30fc\u30f3\u306e\u884c\u3092\u62bd\u51fa\u30fb\u96c6\u8a08<\/li>\n\n\n\n<li><strong>URL\u306e\u6b63\u898f\u5316<\/strong> \u2013 \u7570\u306a\u308b\u5f62\u5f0f\u306eURL\u3092\u6a19\u6e96\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u51e6\u7406\u306e\u5b9f\u88c5<\/li>\n\n\n\n<li><strong>CSV\u30d1\u30fc\u30b5\u30fc<\/strong> \u2013 \u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066CSV\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u6790\u3057\u3001\u914d\u5217\u306b\u5909\u63db<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e0a\u7d1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30de\u30fc\u30af\u30c0\u30a6\u30f3\u30d1\u30fc\u30b5\u30fc<\/strong> \u2013 \u30de\u30fc\u30af\u30c0\u30a6\u30f3\u8a18\u6cd5\u3092HTML\u306b\u5909\u63db\u3059\u308b\u30d1\u30fc\u30b5\u30fc\u306e\u5b9f\u88c5<\/li>\n\n\n\n<li><strong>\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30bf\u30fc<\/strong> \u2013 PHP\u30b3\u30fc\u30c9\u306b\u69cb\u6587\u30cf\u30a4\u30e9\u30a4\u30c8\u3092\u9069\u7528\u3059\u308b\u30b3\u30f3\u30d0\u30fc\u30bf\u30fc\u306e\u4f5c\u6210<\/li>\n\n\n\n<li><strong>HTML\u30d1\u30fc\u30b5\u30fc<\/strong> \u2013 \u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066HTML\u304b\u3089\u7279\u5b9a\u8981\u7d20\u3084\u5c5e\u6027\u3092\u62bd\u51fa\u3059\u308b\u30c4\u30fc\u30eb<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-99\">\u5b66\u7fd2\u306e\u30d2\u30f3\u30c8<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c0f\u3055\u306a\u30d1\u30bf\u30fc\u30f3\u304b\u3089\u59cb\u3081\u3066\u5f90\u3005\u306b\u8907\u96d1\u306a\u3082\u306e\u306b\u6311\u6226\u3059\u308b<\/li>\n\n\n\n<li>\u89e3\u6c7a\u7b56\u3092\u898b\u308b\u524d\u306b\u81ea\u5206\u3067\u8003\u3048\u308b\u6642\u9593\u3092\u5341\u5206\u306b\u53d6\u308b<\/li>\n\n\n\n<li>\u8907\u6570\u306e\u6b63\u3057\u3044\u89e3\u6c7a\u7b56\u304c\u3042\u308b\u3053\u3068\u3092\u8a8d\u8b58\u3059\u308b<\/li>\n\n\n\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8003\u616e\u3057\u305f\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08\u3092\u610f\u8b58\u3059\u308b<\/li>\n\n\n\n<li>\u5b9a\u671f\u7684\u306b\u7df4\u7fd2\u3057\u3066\u3001\u30b9\u30ad\u30eb\u3092\u7dad\u6301\u30fb\u5411\u4e0a\u3055\u305b\u308b<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-100\">PHP\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u305f\u3081\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u60c5\u5831\u4ea4\u63db\u306e\u5834<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-101\">\u30d5\u30a9\u30fc\u30e9\u30e0\u3068Q&amp;A\u30b5\u30a4\u30c8<\/h4>\n\n\n<div id=\"id-f00284c2-78db-413e-9e24-62466d6d6bcf\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b5\u30a4\u30c8\u540d<\/th><th>URL<\/th><th>\u7279\u5fb4<\/th><\/tr><\/thead><tbody><tr><td>Stack Overflow<\/td><td><a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/regex+php\">regex+php<\/a><\/td><td>\u8c4a\u5bcc\u306a\u8cea\u554f\u3068\u56de\u7b54\u306e\u84c4\u7a4d\u3001\u5c02\u9580\u5bb6\u304b\u3089\u306e\u56de\u7b54<\/td><\/tr><tr><td>PHP.net\u516c\u5f0f\u30d5\u30a9\u30fc\u30e9\u30e0<\/td><td><a href=\"https:\/\/externals.io\/\">externals.io<\/a><\/td><td>PHP\u958b\u767a\u8005\u3068\u306e\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3<\/td><\/tr><tr><td>Reddit \u2013 r\/regex<\/td><td><a href=\"https:\/\/www.reddit.com\/r\/regex\/\">r\/regex<\/a><\/td><td>\u30ab\u30b8\u30e5\u30a2\u30eb\u306a\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u3001\u5e45\u5e83\u3044\u30c8\u30d4\u30c3\u30af<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-102\">\u65e5\u672c\u8a9e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3<\/h4>\n\n\n\n<p>\u65e5\u672c\u8a9e\u3067\u8cea\u554f\u3084\u60c5\u5831\u4ea4\u63db\u304c\u3067\u304d\u308b\u5834\u3082\u5145\u5b9f\u3057\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/teratail.com\/tags\/PHP\">teratail<\/a><\/strong> \u2013 \u65e5\u672c\u8a9e\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8cea\u554f\u30b5\u30a4\u30c8\u3002PHP\u3084\u6b63\u898f\u8868\u73fe\u306e\u30bf\u30b0\u3067\u8cea\u554f\u53ef\u80fd<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/qiita.com\/tags\/%E6%AD%A3%E8%A6%8F%E8%A1%A8%E7%8F%BE\">Qiita<\/a><\/strong> \u2013 \u8cea\u306e\u9ad8\u3044\u6280\u8853\u8a18\u4e8b\u3001\u65e5\u672c\u8a9e\u3067\u306e\u60c5\u5831\u5171\u6709<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/phpusers.connpass.com\/\">PHP\u30e6\u30fc\u30b6\u30fc\u30ba<\/a><\/strong> \u2013 \u65e5\u672c\u306ePHP\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u3002\u52c9\u5f37\u4f1a\u3084\u30a4\u30d9\u30f3\u30c8\u60c5\u5831\u3082<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-103\">\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3068\u30ea\u30bd\u30fc\u30b9<\/h4>\n\n\n<div id=\"id-8af8f0d4-374d-41aa-a639-ff1f608a4768\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30c4\u30fc\u30eb\u540d<\/th><th>URL<\/th><th>\u7279\u5fb4<\/th><\/tr><\/thead><tbody><tr><td>Regex101<\/td><td><a href=\"https:\/\/regex101.com\/\">regex101.com<\/a><\/td><td>\u5bfe\u8a71\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u3001\u30d1\u30bf\u30fc\u30f3\u306e\u8a73\u7d30\u8aac\u660e\u6a5f\u80fd<\/td><\/tr><tr><td>PHPLiveRegex<\/td><td><a href=\"https:\/\/www.phpliveregex.com\/\">phpliveregex.com<\/a><\/td><td>PHP\u7279\u5316\u306e\u6b63\u898f\u8868\u73fe\u30c6\u30b9\u30bf\u30fc<\/td><\/tr><tr><td>RegExr<\/td><td><a href=\"https:\/\/regexr.com\/\">regexr.com<\/a><\/td><td>\u8996\u899a\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u8aac\u660e\u3001\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30ac\u30a4\u30c9<\/td><\/tr><tr><td>ExplainRegex<\/td><td><a href=\"https:\/\/www.explainregex.com\/\">explainregex.com<\/a><\/td><td>\u6b63\u898f\u8868\u73fe\u3092\u82f1\u8a9e\u3067\u8aac\u660e\u3057\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-104\">\u30cb\u30e5\u30fc\u30b9\u30ec\u30bf\u30fc\u3068\u30d6\u30ed\u30b0<\/h4>\n\n\n\n<p>\u6700\u65b0\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30c1\u30a2\u30c3\u30d7\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30ea\u30bd\u30fc\u30b9\u304c\u5f79\u7acb\u3061\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/www.phpweekly.com\/\">PHP Weekly<\/a><\/strong> \u2013 PHP\u95a2\u9023\u306e\u30cb\u30e5\u30fc\u30b9\u3084\u8a18\u4e8b\u3092\u307e\u3068\u3081\u305f\u9031\u520a\u30cb\u30e5\u30fc\u30b9\u30ec\u30bf\u30fc<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.regular-expressions.info\/blog\/\">Regular-Expressions.info Blog<\/a><\/strong> \u2013 \u6b63\u898f\u8868\u73fe\u5c02\u9580\u5bb6\u306b\u3088\u308b\u6d1e\u5bdf<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/laracasts.com\/\">Laracasts<\/a><\/strong> \u2013 PHP\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30b9\u30c8\u3002\u5b9f\u7528\u7684\u306a\u30d3\u30c7\u30aa\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/li>\n<\/ul>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306e\u5b66\u7fd2\u306f\u7d99\u7d9a\u7684\u306a\u30d7\u30ed\u30bb\u30b9\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u6d3b\u7528\u3057\u306a\u304c\u3089\u3001\u5c11\u3057\u305a\u3064\u77e5\u8b58\u3092\u7a4d\u307f\u91cd\u306d\u3066\u3044\u304f\u3053\u3068\u3067\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3051\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3068\u3057\u3066\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002\u5b9f\u8df5\u3092\u91cd\u306d\u308b\u3053\u3068\u304c\u3082\u3063\u3068\u3082\u91cd\u8981\u3067\u3042\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,63],"tags":[],"class_list":{"0":"post-3457","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-php","7":"category-php-syntax","8":"nothumb"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3457"}],"version-history":[{"count":2,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3457\/revisions"}],"predecessor-version":[{"id":3459,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3457\/revisions\/3459"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}