{"id":9099,"date":"2024-06-27T12:35:39","date_gmt":"2024-06-27T03:35:39","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=9099"},"modified":"2024-06-28T11:34:27","modified_gmt":"2024-06-28T02:34:27","slug":"%ec%a0%95%ea%b7%9c%ed%91%9c%ed%98%84%ec%8b%9d","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=9099","title":{"rendered":"\uc815\uaddc\ud45c\ud604\uc2dd"},"content":{"rendered":"<h1>\uc815\uaddc\ud45c\ud604\uc2dd<\/h1>\n<p><a href=\"https:\/\/hamait.tistory.com\/342\">\ucc38\uc870<\/a><\/p>\n<p>\uc815\uaddc\ud45c\ud604\uc2dd\uc740 \uc5b8\uc5b4\ub9c8\ub2e4 \ube44\uc2b7\ud558\uba74\uc11c\ub3c4 \ub2e4\ub978 \ubd80\ubd84\uc774 \ub9ce\uc2b5\ub2c8\ub2e4.<br \/>\n\uc544\ub798\uc5d0\uc11c\ub294 \ub300\uccb4\uc801\uc73c\ub85c \uacf5\ud1b5\uc801\uc778 \ubd80\ubd84\uc744 \uc815\ub9ac\ud574 \ub193\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud558\uc9c0\ub9cc \uc2e4\uc81c \uc0ac\uc6a9\ud558\uae30 \uc804\uc5d0\ub294 <code>java regex<\/code> \uc640 \uac19\uc774 \ud2b9\uc815 \uc5b8\uc5b4\uc5d0\uc11c\ub294 \uc5b4\ub5bb\uac8c \uc815\uaddc\uc2dd\uc774 \uc4f0\uc774\uace0 \uc788\ub294\uc9c0 \ud655\uc778\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<h2>\uc628\ub77c\uc778 \ud30c\uc774\uc120 \uc2e4\ud589<\/h2>\n<p><a href=\"https:\/\/www.online-python.com\/\">https:\/\/www.online-python.com\/<\/a><\/p>\n<h2>\uae30\ubcf8 \ubb38\ubc95<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Meta char<\/th>\n<th style=\"text-align: center;\">\uc0ac\uc6a9\ubc95<\/th>\n<th>\uc758\ubbf8<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">^<\/td>\n<td style=\"text-align: center;\">^x<\/td>\n<td>\ubb38\uc790\uc5f4\uc758 \uc2dc\uc791\uc744 \ud45c\ud604\ud558\uba70 x \ubb38\uc790\ub85c \uc2dc\uc791\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">$<\/td>\n<td style=\"text-align: center;\">x$<\/td>\n<td>\ubb38\uc790\uc5f4\uc758 \uc885\ub8cc\ub97c \ud45c\ud604\ud558\uba70 x \ubb38\uc790\ub85c \ub05d\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">*<\/td>\n<td style=\"text-align: center;\">x*<\/td>\n<td>\ubc18\ubcf5\uc5ec\ubd80\ub97c \ud45c\ud604\ud558\uba70 x \ubb38\uc790\uac00 0\ubc88 \ub610\ub294 \uadf8 \uc774\uc0c1 \ubc18\ubcf5\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">.<\/td>\n<td style=\"text-align: center;\">.x<\/td>\n<td>\uc784\uc758\uc758 \ud55c \ubb38\uc790\uc758 \uc790\ub9ac\uc218\ub97c \ud45c\ud604\ud558\uba70 \ubb38\uc790\uc5f4\uc774 x \ub85c \ub05d\ub09c\ub2e4\ub294 \uac83\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">+<\/td>\n<td style=\"text-align: center;\">x+<\/td>\n<td>\ubc18\ubcf5\uc744 \ud45c\ud604\ud558\uba70 x \ubb38\uc790\uac00 \ud55c\ubc88 \uc774\uc0c1 \ubc18\ubcf5\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">?<\/td>\n<td style=\"text-align: center;\">x?<\/td>\n<td>\uc874\uc7ac\uc5ec\ubd80\ub97c \ud45c\ud604\ud558\uba70 x \ubb38\uc790\uac00 \uc874\uc7ac\ud560 \uc218\ub3c4, \uc874\uc7ac\ud558\uc9c0 \uc54a\uc744 \uc218\ub3c4 \uc788\uc74c\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">|<\/td>\n<td style=\"text-align: center;\">x|y<\/td>\n<td>or \ub97c \ud45c\ud604\ud558\uba70 x \ub610\ub294 y \ubb38\uc790\uac00 \uc874\uc7ac\ud568\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">()<\/td>\n<td style=\"text-align: center;\">(x)<\/td>\n<td>\uadf8\ub8f9\uc744 \ud45c\ud604\ud558\uba70 x \ub97c \uadf8\ub8f9\uc73c\ub85c \ucc98\ub9ac\ud568\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">{n}<\/td>\n<td style=\"text-align: center;\">x{n}<\/td>\n<td>\ubc18\ubcf5\uc744 \ud45c\ud604\ud558\uba70 x \ubb38\uc790\uac00 n\ubc88 \ubc18\ubcf5\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">{n,}<\/td>\n<td style=\"text-align: center;\">x{n,}<\/td>\n<td>\ubc18\ubcf5\uc744 \ud45c\ud604\ud558\uba70 x \ubb38\uc790\uac00 n\ubc88 \uc774\uc0c1 \ubc18\ubcf5\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">{n,m}<\/td>\n<td style=\"text-align: center;\">x{n,m}<\/td>\n<td>\ubc18\ubcf5\uc744 \ud45c\ud604\ud558\uba70 x \ubb38\uc790\uac00 \ucd5c\uc18c n\ubc88 \uc774\uc0c1 \ucd5c\ub300 m \ubc88 \uc774\ud558\ub85c \ubc18\ubcf5\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\uc0d8\ud50c<\/h2>\n<p><code>^<\/code> \uac00 \ub9e4\uce6d\ub418\ub294 \ubb38\uc7a5\uc758 \uc2dc\uc791\uc744 \ub9d0\ud569\ub2c8\ub2e4.<br \/>\n<code>$<\/code> \uac00 \ub9e4\uce6d\ub418\ub294 \ubb38\uc7a5\uc758 \ub05d\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4.<br \/>\n<code>.*<\/code> \ub294 \uc784\uc758\uc758 \ud55c\uac1c\uc758 \ubb38\uc790\uac00 0 \ubc88 \uc774\uc0c1(\uc5c6\uc5b4\ub3c4 \ub9e4\uce6d\ub418\uace0, 1\uac1c \uc774\uc0c1\ub3c4 \ub9e4\uce6d) \uc788\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;The rain in Spain&quot;\nx = re.search(&quot;^The.*Spain$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<p><code>-?<\/code> \ub294 <code>-<\/code> \uac00 \uc788\uac70\ub098 \uc5c6\uac70\ub098 \ub9e4\uce6d\ub429\ub2c8\ub2e4.<br \/>\n<code>1+<\/code> \ub294 <code>1<\/code> \uc774 \ud55c\uac1c \uc774\uc0c1 \uc788\uc73c\uba74 \ub9e4\uce6d\ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;010-1112222&quot;\n# 010-111-2222\nx = re.search(&quot;^010-?1+-?2+$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<p><code>\\.<\/code> \uc758 \ud615\uc2dd\uc73c\ub85c <code>.<\/code> \uc774 \uc784\uc758\uc758 \ubb38\uc790\uac00 \uc544\ub2c8\ub77c \uc2e4\uc81c <code>.<\/code> (dot char) \ud558\uace0\ub9cc \ub9e4\uce6d\ub418\ub3c4\ub85d \ubcc0\uacbd\ud569\ub2c8\ub2e4.<br \/>\n<code>(com|co\\.kr)<\/code> \uc758 \ud615\uc2dd\uc73c\ub85c \ubb38\uc790\uc5f4\uc744 \ud558\ub098\uc758 \uc138\ud2b8\ub85c \ubb36\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n<code>com<\/code> or <code>co.kr<\/code> \uc774\ub77c\ub294 \uc758\ubbf8\uac00 \ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;google.com&quot;\n# google.com, google.co.kr\nx = re.search(&quot;google\\.(com|co\\.kr)&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<p><code>(-1+)<\/code> \uac00 2\uac1c \uc77c\ub54c\ub9cc \ub9e4\uce6d\ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;010-111-1111&quot;\n# 010-111-1111\nx = re.search(&quot;010(-1+){2}&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<h2>[] \uc0ac\uc6a9\ubc95<\/h2>\n<table>\n<thead>\n<tr>\n<th>\uc815\uaddc\uc2dd<\/th>\n<th>\uc758\ubbf8<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>[xy]<\/td>\n<td>\ubb38\uc790 \uc120\ud0dd\uc744 \ud45c\ud604\ud558\uba70 x \uc640 y \uc911\uc5d0 \ud558\ub098\ub97c \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>[^xy]<\/td>\n<td>not \uc744 \ud45c\ud604\ud558\uba70 \u00a0x \ubc0f y \ub97c \uc81c\uc678\ud55c \ubb38\uc790\ub97c \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<tr>\n<td>[x-z]<\/td>\n<td>range\ub97c \ud45c\ud604\ud558\uba70 x ~ z \uc0ac\uc774\uc758 \ubb38\uc790\ub97c \uc758\ubbf8\ud55c\ub2e4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\uc0d8\ud50c<\/h2>\n<p>\ud2b9\uc815 \ubb38\uc790\ub9cc \ub098\uc5f4\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;hello&quot;\nx = re.search(&quot;^[helo]+$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<p>\ud2b9\uc815 \ubb38\uc790\ub9cc \uc81c\uc678\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;hello&quot;\n# hello\nx = re.search(&quot;^[^a-d]+$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<p><code>[0-9]<\/code> \uc640 \uac19\uc774 \ubaa8\ub4e0 \uc22b\uc790\uc5d0 \ub9e4\uce6d\ud558\uac8c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;010-12345678&quot;\n# 010-12345678\nx = re.search(&quot;^010-?[0-9]+-?[0-9]+$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<p>\uc22b\uc790, \ub300\ubb38\uc790, \uc18c\ubb38\uc790, \ubc11\uc904\ubb38\uc790, \ud558\uc774\ud508(-) \ub97c \ubaa8\ub450 \ub9e4\uce6d\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n\uc8fc\uc758\ud560 \uac83\uc740 \ud558\uc774\ud508(-) \uc740 \ubb34\uc870\uac74 \ub9e8 \ub9c8\uc9c0\ub9c9\uc5d0 \ub098\uc5f4\ub418\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;my-mail_test@gmail.co.kr&quot;\n# my-mail_test@gmail.co.kr\nx = re.search(&quot;^[0-9a-zA-Z_-]+@[0-9a-zA-Z_-]+(\\.[a-zA-Z]+)+$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<h2>\uc774\uc2a4\ucf00\uc774\ud504<\/h2>\n<p>\uc704\uc5d0\uc11c \uc0ac\uc6a9\ub418\uace0 \uc788\ub294 \ud2b9\uc218\ubb38\uc790 \uc790\uccb4\ub97c \uac80\uc0c9\ud558\uace0\uc790 \ud560 \ub54c\uac00 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n\uc544\ub798\ucc98\ub7fc \ud2b9\uc218\ubb38\uc790 \uc55e\uc5d0 <code>\\<\/code> \ub97c \ubd99\uc5ec\uc11c \ud2b9\uc218\ubb38\uc790\ub85c \uc791\ub3d9\ud558\uc9c0 \uc54a\uace0 \uc77c\ubc18\ubb38\uc790\ub85c \uc778\uc2dd\ub418\uac8c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">import re\n\ntxt = &quot;Hello, World?&quot;\n# Hello, World?\nx = re.search(&quot;^[0-9a-zA-Z_, \\?-]+$&quot;, txt)\n\nif x:\n  print(&quot;match!&quot;)\nelse:\n  print(&quot;No match&quot;)<\/code><\/pre>\n<h2>\ucf54\ub9e8\ud2b8 \ucd94\uac00\ud574 \ub193\uae30<\/h2>\n<p>\uc815\uaddc\uc2dd\uc740 \uc870\uae08\ub9cc \uae38\uc5b4\uc838\ub3c4 \ud574\uc11d\ud558\uae30 \ub300\ub2e8\ud788 \ud798\ub4e4\uace0,<br \/>\n\ubcf8\uc778\uc774 \uc791\uc131\ud574 \ub193\uace0\ub3c4 1\uc8fc\uc77c\ub9cc \uc9c0\ub098\uba74 \uae30\ub2a5\uc744 \ud655\uc778\ud558\uae30 \uc704\ud574,<br \/>\n\uc0c1\ub2f9\ud55c \uc2dc\uac04\uc744 \ub4e4\uc5ec \ud574\uc11d\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ubcf8\uc778\uc744 \uc704\ud574\uc11c\uac74 \ub2e4\ub978\uc0ac\ub78c\uc744 \uc704\ud574\uc11c\uac74 \ud56d\uc0c1<br \/>\n\ucf54\ub9e8\ud2b8\ub97c \ubd99\uc5ec\ub193\uc544 \ub9e4\ubc88 \ud574\uc11d\ud574\uc57c \ud558\ub294 \uc2dc\uac04\uc744 \uc544\ub084 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ucf54\ub9e8\ud2b8\ub294 \uc785\ub825\ud558\ub824\ub294 \ubcc0\uc218\ub97c \uc801\uc5b4\ub193\ub294 \uac83\uc774 \uac00\uc7a5 \ubb34\ub09c\ud569\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc815\uaddc\ud45c\ud604\uc2dd \ucc38\uc870 \uc815\uaddc\ud45c\ud604\uc2dd\uc740 \uc5b8\uc5b4\ub9c8\ub2e4 \ube44\uc2b7\ud558\uba74\uc11c\ub3c4 \ub2e4\ub978 \ubd80\ubd84\uc774 \ub9ce\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc5d0\uc11c\ub294 \ub300\uccb4\uc801\uc73c\ub85c \uacf5\ud1b5\uc801\uc778 \ubd80\ubd84\uc744 \uc815\ub9ac\ud574 \ub193\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc2e4\uc81c \uc0ac\uc6a9\ud558\uae30 \uc804\uc5d0\ub294 java regex \uc640 \uac19\uc774 \ud2b9\uc815 \uc5b8\uc5b4\uc5d0\uc11c\ub294 \uc5b4\ub5bb\uac8c \uc815\uaddc\uc2dd\uc774 \uc4f0\uc774\uace0 \uc788\ub294\uc9c0 \ud655\uc778\ud574\uc57c \ud569\ub2c8\ub2e4. \uc628\ub77c\uc778 \ud30c\uc774\uc120 \uc2e4\ud589 https:\/\/www.online-python.com\/ \uae30\ubcf8 \ubb38\ubc95 Meta char \uc0ac\uc6a9\ubc95 \uc758\ubbf8 ^ ^x \ubb38\uc790\uc5f4\uc758 \uc2dc\uc791\uc744 \ud45c\ud604\ud558\uba70 x \ubb38\uc790\ub85c \uc2dc\uc791\ub428\uc744 \uc758\ubbf8\ud55c\ub2e4. $ x$ \ubb38\uc790\uc5f4\uc758 \uc885\ub8cc\ub97c \ud45c\ud604\ud558\uba70 x\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=9099\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-9099","post","type-post","status-publish","format-standard","hentry","category-language"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9099"}],"version-history":[{"count":6,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9099\/revisions"}],"predecessor-version":[{"id":9106,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9099\/revisions\/9106"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}