{"id":1420,"date":"2025-03-11T16:09:02","date_gmt":"2025-03-11T07:09:02","guid":{"rendered":"https:\/\/bokumin45.server-on.net\/blog\/?p=1420"},"modified":"2025-11-17T16:17:33","modified_gmt":"2025-11-17T07:17:33","slug":"linux-%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e3%83%81%e3%83%bc%e3%83%88%e3%82%b7%e3%83%bc%e3%83%88regex","status":"publish","type":"post","link":"https:\/\/www.bokumin.org\/blog\/2025\/03\/11\/linux-%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e3%83%81%e3%83%bc%e3%83%88%e3%82%b7%e3%83%bc%e3%83%88regex\/","title":{"rendered":"Linux \u6b63\u898f\u8868\u73fe\uff08Regex\uff09\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8"},"content":{"rendered":"\n<p>Linux Regular Expression(Regex) Cheat Sheet<\/p>\n\n\n\n<p>Linux\u306e\u6b63\u898f\u8868\u73fe\u3092\u30b5\u30af\u3063\u3068\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u53c2\u8003\u306b\u3057\u3066\u3082\u3089\u3048\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u7279\u6b8a\u6587\u5b57(\u30e1\u30bf\u6587\u5b57)<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b(\u4e00\u81f4\u3059\u308b\u6587\u5b57)<\/th><\/tr><\/thead><tbody><tr><td><code>.<\/code><\/td><td>\u4efb\u610f\u306e1\u6587\u5b57\u306b\u30de\u30c3\u30c1<\/td><td><code>a.c<\/code> \u2192 abc, adc, a1c \u306a\u3069<\/td><\/tr><tr><td><code>^<\/code><\/td><td>\u884c\u306e\u5148\u982d\u306b\u30de\u30c3\u30c1<\/td><td><code>^abc<\/code> \u2192 \u300cabc\u300d\u3067\u59cb\u307e\u308b\u884c<\/td><\/tr><tr><td><code>$<\/code><\/td><td>\u884c\u306e\u672b\u5c3e\u306b\u30de\u30c3\u30c1<\/td><td><code>abc$<\/code> \u2192 \u300cabc\u300d\u3067\u7d42\u308f\u308b\u884c<\/td><\/tr><tr><td><code>*<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u306e0\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><td><code>ab*c<\/code> \u2192 ac, abc, abbc, abbbc\u2026<\/td><\/tr><tr><td><code>\\<\/code><\/td><td>\u6b21\u306e\u6587\u5b57\u3092\u30a8\u30b9\u30b1\u30fc\u30d7<\/td><td><code>\\.<\/code> \u2192 \u30c9\u30c3\u30c8\u6587\u5b57\u305d\u306e\u3082\u306e<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u203b <code>+<\/code>, <code>?<\/code>, <code>|<\/code>, <code>()<\/code>, <code>{}<\/code> \u306f<strong>\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)\u307e\u305f\u306fPCRE<\/strong>\u3067\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002\u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE)\u3067\u306f <code>\\+<\/code>, <code>\\?<\/code>, <code>\\|<\/code>, <code>\\(<\/code> <code>\\)<\/code>, <code>\\{<\/code> <code>\\}<\/code> \u3068\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u6587\u5b57\u30af\u30e9\u30b9\u3068\u7bc4\u56f2<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b(\u4e00\u81f4\u3059\u308b\u6587\u5b57)<\/th><\/tr><\/thead><tbody><tr><td><code>[abc]<\/code><\/td><td>\u62ec\u5f27\u5185\u306e\u3044\u305a\u308c\u304b1\u6587\u5b57\u306b\u30de\u30c3\u30c1<\/td><td><code>[abc]<\/code> \u2192 a, b, \u307e\u305f\u306f c<\/td><\/tr><tr><td><code>[^abc]<\/code><\/td><td>\u62ec\u5f27\u5185\u4ee5\u5916\u306e\u4efb\u610f\u306e1\u6587\u5b57\u306b\u30de\u30c3\u30c1<\/td><td><code>[^abc]<\/code> \u2192 a, b, c \u4ee5\u5916\u306e\u4efb\u610f\u306e\u6587\u5b57<\/td><\/tr><tr><td><code>[a-z]<\/code><\/td><td>\u7bc4\u56f2\u6307\u5b9a(a \u304b\u3089 z \u306e\u5c0f\u6587\u5b57)<\/td><td><code>[a-z]<\/code> \u2192 \u5c0f\u6587\u5b57\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c81\u6587\u5b57<\/td><\/tr><tr><td><code>[A-Z]<\/code><\/td><td>\u7bc4\u56f2\u6307\u5b9a(A \u304b\u3089 Z \u306e\u5927\u6587\u5b57)<\/td><td><code>[A-Z]<\/code> \u2192 \u5927\u6587\u5b57\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c81\u6587\u5b57<\/td><\/tr><tr><td><code>[0-9]<\/code><\/td><td>\u7bc4\u56f2\u6307\u5b9a(0 \u304b\u3089 9 \u306e\u6570\u5b57)<\/td><td><code>[0-9]<\/code> \u2192 \u4efb\u610f\u306e\u6570\u5b571\u6587\u5b57<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>POSIX\u6587\u5b57\u30af\u30e9\u30b9<\/strong><\/h2>\n\n\n\n<p>\u4f7f\u7528\u6642\u306f <code>[[:alnum:]]<\/code> \u306e\u3088\u3046\u306b\u4e8c\u91cd\u306e\u62ec\u5f27\u3067\u56f2\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>[:alnum:]<\/code><\/td><td>\u82f1\u6570\u5b57<\/td><td><code>[[:alnum:]]<\/code> \u2192 a-z, A-Z, 0-9<\/td><\/tr><tr><td><code>[:alpha:]<\/code><\/td><td>\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8<\/td><td><code>[[:alpha:]]<\/code> \u2192 a-z, A-Z<\/td><\/tr><tr><td><code>[:blank:]<\/code><\/td><td>\u7a7a\u767d(\u30b9\u30da\u30fc\u30b9\u3068\u30bf\u30d6)<\/td><td><code>[[:blank:]]<\/code> \u2192 \u30b9\u30da\u30fc\u30b9\u307e\u305f\u306f\u30bf\u30d6<\/td><\/tr><tr><td><code>[:digit:]<\/code><\/td><td>\u6570\u5b57<\/td><td><code>[[:digit:]]<\/code> \u2192 0-9<\/td><\/tr><tr><td><code>[:lower:]<\/code><\/td><td>\u5c0f\u6587\u5b57<\/td><td><code>[[:lower:]]<\/code> \u2192 a-z<\/td><\/tr><tr><td><code>[:upper:]<\/code><\/td><td>\u5927\u6587\u5b57<\/td><td><code>[[:upper:]]<\/code> \u2192 A-Z<\/td><\/tr><tr><td><code>[:space:]<\/code><\/td><td>\u7a7a\u767d\u6587\u5b57<\/td><td><code>[[:space:]]<\/code> \u2192 \u30b9\u30da\u30fc\u30b9\u3001\u30bf\u30d6\u3001\u6539\u884c\u306a\u3069<\/td><\/tr><tr><td><code>[:punct:]<\/code><\/td><td>\u53e5\u8aad\u70b9<\/td><td><code>[[:punct:]]<\/code> \u2192 \u53e5\u8aad\u70b9\u8a18\u53f7<\/td><\/tr><tr><td><code>[:xdigit:]<\/code><\/td><td>16\u9032\u6570\u306e\u6570\u5b57<\/td><td><code>[[:xdigit:]]<\/code> \u2192 0-9, a-f, A-F<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u7e70\u308a\u8fd4\u3057\u6307\u5b9a<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE: grep, sed)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>\\{n\\}<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u3092\u3061\u3087\u3046\u3069n\u56de\u7e70\u308a\u8fd4\u3059<\/td><td><code>a\\{3\\}<\/code> \u2192 aaa<\/td><\/tr><tr><td><code>\\{n,\\}<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u3092n\u56de\u4ee5\u4e0a\u7e70\u308a\u8fd4\u3059<\/td><td><code>a\\{2,\\}<\/code> \u2192 aa, aaa, aaaa\u2026<\/td><\/tr><tr><td><code>\\{n,m\\}<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u3092n\u56de\u4ee5\u4e0am\u56de\u4ee5\u4e0b\u7e70\u308a\u8fd4\u3059<\/td><td><code>a\\{2,4\\}<\/code> \u2192 aa, aaa, aaaa<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE: grep -E, egrep)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>+<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u306e1\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><td><code>ab+c<\/code> \u2192 abc, abbc, abbbc\u2026<\/td><\/tr><tr><td><code>?<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u306e0\u56de\u307e\u305f\u306f1\u56de\u306e\u51fa\u73fe<\/td><td><code>ab?c<\/code> \u2192 ac, abc<\/td><\/tr><tr><td><code>{n}<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u3092\u3061\u3087\u3046\u3069n\u56de\u7e70\u308a\u8fd4\u3059<\/td><td><code>a{3}<\/code> \u2192 aaa<\/td><\/tr><tr><td><code>{n,}<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u3092n\u56de\u4ee5\u4e0a\u7e70\u308a\u8fd4\u3059<\/td><td><code>a{2,}<\/code> \u2192 aa, aaa, aaaa\u2026<\/td><\/tr><tr><td><code>{n,m}<\/code><\/td><td>\u76f4\u524d\u306e\u6587\u5b57\u3092n\u56de\u4ee5\u4e0am\u56de\u4ee5\u4e0b\u7e70\u308a\u8fd4\u3059<\/td><td><code>a{2,4}<\/code> \u2192 aa, aaa, aaaa<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u203b GNU grep\u3067\u306f\u57fa\u672c\u6b63\u898f\u8868\u73fe\u3067\u3082 <code>\\+<\/code> \u304c\u4f7f\u3048\u307e\u3059\u304c\u3001\u3053\u308c\u306fGNU\u62e1\u5f35\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u9078\u629e\u3068\u4ee3\u66ff<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE)<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>|<\/code><\/td><td>\u9078\u629e(OR\u6f14\u7b97\u5b50)<\/td><td><code>cat|dog<\/code> \u2192 \u300ccat\u300d\u307e\u305f\u306f\u300cdog\u300d<\/td><\/tr><tr><td><code>\\(<\/code> <code>\\)<\/code><\/td><td>\u30b0\u30eb\u30fc\u30d7\u5316<\/td><td><code>\\(cat|dog\\)s<\/code> \u2192 \u300ccats\u300d\u307e\u305f\u306f\u300cdogs\u300d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>`<\/td><td>`<\/td><td>\u9078\u629e(OR\u6f14\u7b97\u5b50)<\/td><\/tr><tr><td><code>(<\/code> <code>)<\/code><\/td><td>\u30b0\u30eb\u30fc\u30d7\u5316<\/td><td>`(cat<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u30a8\u30b9\u30b1\u30fc\u30d7\u30b7\u30fc\u30b1\u30f3\u30b9\u3068\u7279\u6b8a\u8868\u73fe<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>BRE\/ERE\u5171\u901a<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>\\n<\/code><\/td><td>\u6539\u884c\u6587\u5b57<\/td><td><code>line\\n<\/code> \u2192 \u300cline\u300d\u306e\u5f8c\u306b\u6539\u884c<\/td><\/tr><tr><td><code>\\t<\/code><\/td><td>\u30bf\u30d6\u6587\u5b57<\/td><td><code>column\\t<\/code> \u2192 \u300ccolumn\u300d\u306e\u5f8c\u306b\u30bf\u30d6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>PCRE\u5c02\u7528(grep -P)<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>\\d<\/code><\/td><td>\u6570\u5b57\u4e00\u6587\u5b57 <code>[0-9]<\/code> \u3068\u540c\u7b49<\/td><td><code>\\d{3}<\/code> \u2192 3\u6841\u306e\u6570\u5b57<\/td><\/tr><tr><td><code>\\D<\/code><\/td><td>\u975e\u6570\u5b57 <code>[^0-9]<\/code> \u3068\u540c\u7b49<\/td><td><code>\\D+<\/code> \u2192 1\u6587\u5b57\u4ee5\u4e0a\u306e\u975e\u6570\u5b57<\/td><\/tr><tr><td><code>\\w<\/code><\/td><td>\u5358\u8a9e\u69cb\u6210\u6587\u5b57 <code>[a-zA-Z0-9_]<\/code> \u3068\u540c\u7b49<\/td><td><code>\\w+<\/code> \u2192 1\u6587\u5b57\u4ee5\u4e0a\u306e\u5358\u8a9e\u69cb\u6210\u6587\u5b57<\/td><\/tr><tr><td><code>\\W<\/code><\/td><td>\u975e\u5358\u8a9e\u69cb\u6210\u6587\u5b57<\/td><td><code>\\W+<\/code> \u2192 1\u6587\u5b57\u4ee5\u4e0a\u306e\u975e\u5358\u8a9e\u69cb\u6210\u6587\u5b57<\/td><\/tr><tr><td><code>\\s<\/code><\/td><td>\u7a7a\u767d\u6587\u5b57<\/td><td><code>\\s+<\/code> \u2192 1\u6587\u5b57\u4ee5\u4e0a\u306e\u7a7a\u767d\u6587\u5b57<\/td><\/tr><tr><td><code>\\S<\/code><\/td><td>\u975e\u7a7a\u767d\u6587\u5b57<\/td><td><code>\\S+<\/code> \u2192 1\u6587\u5b57\u4ee5\u4e0a\u306e\u975e\u7a7a\u767d\u6587\u5b57<\/td><\/tr><tr><td><code>\\b<\/code><\/td><td>\u5358\u8a9e\u5883\u754c<\/td><td><code>\\bcat\\b<\/code> \u2192 \u5358\u8a9e\u300ccat\u300d\u306e\u307f<\/td><\/tr><tr><td><code>\\B<\/code><\/td><td>\u975e\u5358\u8a9e\u5883\u754c<\/td><td><code>\\Bcat\\B<\/code> \u2192 \u300ccat\u300d\u304c\u5358\u8a9e\u306e\u4e2d\u9593<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u203b <code>\\d<\/code>, <code>\\w<\/code>, <code>\\s<\/code> \u306a\u3069\u306fPerl\u4e92\u63db\u6b63\u898f\u8868\u73fe(PCRE)\u306e\u6a5f\u80fd\u3067\u3001<code>grep -P<\/code> \u3067\u306e\u307f\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002\u901a\u5e38\u306egrep\/sed\u3067\u306f\u4f7f\u3048\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u6587\u5b57\u30b3\u30fc\u30c9\u6307\u5b9a<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>\\ooo<\/code><\/td><td>8\u9032\u6570\u30b3\u30fc\u30c9(3\u6841)\u306e\u6587\u5b57<\/td><td><code>\\101<\/code> \u2192 A<\/td><\/tr><tr><td><code>\\xhh<\/code><\/td><td>16\u9032\u6570\u30b3\u30fc\u30c9(2\u6841)\u306e\u6587\u5b57<\/td><td><code>\\x41<\/code> \u2192 A<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u30d0\u30c3\u30af\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9(\u5f8c\u65b9\u53c2\u7167)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE)<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sed 's\/\\(abc\\)\\1\/XYZ\/g'  # abcabc \u2192 XYZ<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/\\(abc\\)\\1\/XYZ\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\">  <\/span><span style=\"color: #464B5D; font-style: italic\"># abcabc \u2192 XYZ<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sed -E 's\/(abc)\\1\/XYZ\/g'  # abcabc \u2192 XYZ<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-E<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/(abc)\\1\/XYZ\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\">  <\/span><span style=\"color: #464B5D; font-style: italic\"># abcabc \u2192 XYZ<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>\\1<\/code>, <code>\\2<\/code>\u2026<\/td><td>\u524d\u306e\u62ec\u5f27\u3067\u56f2\u307e\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3092\u53c2\u7167<\/td><td><code>\\(abc\\)\\1<\/code> \u2192 abcabc(BRE)<\/td><\/tr><tr><td><\/td><td><\/td><td><code>(abc)\\1<\/code> \u2192 abcabc(ERE)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u203b\u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7 <code>(?&lt;name&gt;)<\/code> \u306fPCRE\u3067\u306e\u307f\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u5148\u8aad\u307f\u30fb\u5f8c\u8aad\u307f(PCRE\u5c02\u7528: grep -P)<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>(?=pattern)<\/code><\/td><td>\u80af\u5b9a\u5148\u8aad\u307f<\/td><td><code>foo(?=bar)<\/code> \u2192 \u300cfoobar\u300d\u306e\u300cfoo\u300d<\/td><\/tr><tr><td><code>(?!pattern)<\/code><\/td><td>\u5426\u5b9a\u5148\u8aad\u307f<\/td><td><code>foo(?!bar)<\/code> \u2192 \u5f8c\u308d\u306b\u300cbar\u300d\u304c\u306a\u3044\u300cfoo\u300d<\/td><\/tr><tr><td><code>(?&lt;=pattern)<\/code><\/td><td>\u80af\u5b9a\u5f8c\u8aad\u307f<\/td><td><code>(?&lt;=foo)bar<\/code> \u2192 \u300cfoobar\u300d\u306e\u300cbar\u300d<\/td><\/tr><tr><td><code>(?&lt;!pattern)<\/code><\/td><td>\u5426\u5b9a\u5f8c\u8aad\u307f<\/td><td><code>(?&lt;!foo)bar<\/code> \u2192 \u524d\u306b\u300cfoo\u300d\u304c\u306a\u3044\u300cbar\u300d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u305d\u306e\u4ed6\u306e\u7279\u6b8a\u69cb\u6587(PCRE)<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8a18\u53f7<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>(?:pattern)<\/code><\/td><td>\u975e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/td><td><code>(?:abc)+<\/code> \u2192 \u300cabc\u300d\u306e1\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><\/tr><tr><td><code>(?i)<\/code><\/td><td>\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044<\/td><td><code>(?i)abc<\/code> \u2192 ABC, abc, Abc\u306a\u3069<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>sed\u7f6e\u63db\u30b3\u30de\u30f3\u30c9\u306e\u30d5\u30e9\u30b0<\/strong><\/h2>\n\n\n\n<p>sed\u306e\u7f6e\u63db\u30b3\u30de\u30f3\u30c9 <code>s\/\u691c\u7d22\/\u7f6e\u63db\/\u30d5\u30e9\u30b0<\/code> \u3067\u4f7f\u7528\u3067\u304d\u308b\u30d5\u30e9\u30b0\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30d5\u30e9\u30b0<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>g<\/code><\/td><td>\u5404\u884c\u306e\u3059\u3079\u3066\u306e\u30de\u30c3\u30c1\u3092\u7f6e\u63db<\/td><td><code>sed 's\/old\/new\/g'<\/code><\/td><\/tr><tr><td><code>p<\/code><\/td><td>\u7f6e\u63db\u3057\u305f\u884c\u3092\u51fa\u529b<\/td><td><code>sed -n 's\/old\/new\/p'<\/code><\/td><\/tr><tr><td><code>i<\/code> \u307e\u305f\u306f <code>I<\/code><\/td><td>\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044<\/td><td><code>sed 's\/old\/new\/gi'<\/code><\/td><\/tr><tr><td><code>\u6570\u5b57<\/code><\/td><td>n\u756a\u76ee\u306e\u30de\u30c3\u30c1\u306e\u307f\u7f6e\u63db<\/td><td><code>sed 's\/old\/new\/2'<\/code> (2\u756a\u76ee\u306e\u307f)<\/td><\/tr><tr><td><code>w \u30d5\u30a1\u30a4\u30eb<\/code><\/td><td>\u7f6e\u63db\u3057\u305f\u884c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f<\/td><td><code>sed 's\/old\/new\/w out.txt'<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><code>sed 's\/old\/new\/gp'<\/code>\u3000\u3068\u3044\u3063\u305f\u5f62\u306b\u7d44\u307f\u5408\u308f\u305b\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>sed\u30b3\u30de\u30f3\u30c9\u30aa\u30d7\u30b7\u30e7\u30f3<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30aa\u30d7\u30b7\u30e7\u30f3<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>-e<\/code><\/td><td>\u30b9\u30af\u30ea\u30d7\u30c8\u6307\u5b9a(\u8907\u6570\u6307\u5b9a\u53ef)<\/td><td><code>sed -e 's\/a\/b\/' -e 's\/c\/d\/'<\/code><\/td><\/tr><tr><td><code>-i<\/code><\/td><td>\u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u7de8\u96c6(GNU sed)<\/td><td><code>sed -i 's\/old\/new\/g' file.txt<\/code><\/td><\/tr><tr><td><code>-n<\/code><\/td><td>\u81ea\u52d5\u51fa\u529b\u3092\u6291\u5236<\/td><td><code>sed -n '1,5p' file.txt<\/code><\/td><\/tr><tr><td><code>-E<\/code> \u307e\u305f\u306f <code>-r<\/code><\/td><td>\u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528<\/td><td><code>sed -E 's\/(abc)+\/XYZ\/g'<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>Linux\u30c4\u30fc\u30eb\u3054\u3068\u306e\u6b63\u898f\u8868\u73fe\u306e\u9055\u3044<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30c4\u30fc\u30eb<\/th><th>\u6b63\u898f\u8868\u73fe\u30bf\u30a4\u30d7<\/th><th>\u30aa\u30d7\u30b7\u30e7\u30f3<\/th><th>\u6ce8\u610f\u70b9<\/th><\/tr><\/thead><tbody><tr><td><code>grep<\/code><\/td><td>\u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE)<\/td><td>\u30c7\u30d5\u30a9\u30eb\u30c8<\/td><td><code>+<\/code>, <code>?<\/code>, <code>{}<\/code>, `<\/td><\/tr><tr><td><code>grep -E<\/code> \/ <code>egrep<\/code><\/td><td>\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)<\/td><td><code>-E<\/code><\/td><td><code>+<\/code>, <code>?<\/code>, <code>{}<\/code>, `<\/td><\/tr><tr><td><code>grep -P<\/code><\/td><td>Perl\u4e92\u63db\u6b63\u898f\u8868\u73fe(PCRE)<\/td><td><code>-P<\/code><\/td><td><code>\\d<\/code>, <code>\\w<\/code>, <code>\\s<\/code>, \u5148\u8aad\u307f\u30fb\u5f8c\u8aad\u307f\u306a\u3069\u4f7f\u7528\u53ef\u80fd(\u5b9f\u9a13\u7684\u6a5f\u80fd)<\/td><\/tr><tr><td><code>sed<\/code><\/td><td>\u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE)<\/td><td>\u30c7\u30d5\u30a9\u30eb\u30c8<\/td><td><code>+<\/code>, <code>?<\/code>, <code>{}<\/code>, `<\/td><\/tr><tr><td><code>sed -E<\/code><\/td><td>\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)<\/td><td><code>-E<\/code> \u307e\u305f\u306f <code>-r<\/code><\/td><td><code>+<\/code>, <code>?<\/code>, <code>{}<\/code>, `<\/td><\/tr><tr><td><code>awk<\/code><\/td><td>\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)<\/td><td>\u30c7\u30d5\u30a9\u30eb\u30c8<\/td><td>AWK\u72ec\u81ea\u306e\u69cb\u6587\u3068\u5236\u9650\u3042\u308a<\/td><\/tr><tr><td><code>perl<\/code><\/td><td>Perl\u4e92\u63db\u6b63\u898f\u8868\u73fe(PCRE)<\/td><td>\u30c7\u30d5\u30a9\u30eb\u30c8<\/td><td>\u6700\u3082\u5f37\u529b\u3067\u591a\u6a5f\u80fd<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u6ce8\u610f\u70b9<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. \u57fa\u672c\u6b63\u898f\u8868\u73fe(BRE)\u3068\u62e1\u5f35\u6b63\u898f\u8868\u73fe(ERE)\u306e\u9055\u3044<\/strong><\/h3>\n\n\n\n<p>\u57fa\u672c\u6b63\u898f\u8868\u73fe\u3067\u306f <code>+<\/code>, <code>?<\/code>, <code>|<\/code>, <code>()<\/code>, <code>{}<\/code> \u306a\u3069\u306e\u30e1\u30bf\u6587\u5b57\u3092\u4f7f\u3046\u969b\u306b\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u5fc5\u8981\u3067\u3059\u304c\u3001\u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3067\u306f\u3053\u308c\u3089\u3092\u76f4\u63a5\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># BRE (\u57fa\u672c\u6b63\u898f\u8868\u73fe)\ngrep 'a\\{5\\}' file.txt          # aaaaa \u306b\u30de\u30c3\u30c1\ngrep 'aa\\+' file.txt            # aa, aaa, aaaa... \u306b\u30de\u30c3\u30c1(GNU\u62e1\u5f35)\n\n# ERE (\u62e1\u5f35\u6b63\u898f\u8868\u73fe)\ngrep -E 'a{5}' file.txt         # aaaaa \u306b\u30de\u30c3\u30c1\ngrep -E 'aa+' file.txt          # aa, aaa, aaaa... \u306b\u30de\u30c3\u30c1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># BRE (\u57fa\u672c\u6b63\u898f\u8868\u73fe)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">a\\{5\\}<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><span style=\"color: #BABED8\">          <\/span><span style=\"color: #464B5D; font-style: italic\"># aaaaa \u306b\u30de\u30c3\u30c1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">aa\\+<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><span style=\"color: #BABED8\">            <\/span><span style=\"color: #464B5D; font-style: italic\"># aa, aaa, aaaa... \u306b\u30de\u30c3\u30c1(GNU\u62e1\u5f35)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># ERE (\u62e1\u5f35\u6b63\u898f\u8868\u73fe)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-E<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">a{5}<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><span style=\"color: #BABED8\">         <\/span><span style=\"color: #464B5D; font-style: italic\"># aaaaa \u306b\u30de\u30c3\u30c1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-E<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">aa+<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><span style=\"color: #BABED8\">          <\/span><span style=\"color: #464B5D; font-style: italic\"># aa, aaa, aaaa... \u306b\u30de\u30c3\u30c1<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. PCRE(Perl\u4e92\u63db\u6b63\u898f\u8868\u73fe)\u306e\u5229\u7528<\/strong><\/h3>\n\n\n\n<p>GNU grep\u3067\u306f <code>-P<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3067PCRE\u304c\u4f7f\u7528\u3067\u304d\u3001<code>\\d<\/code>, <code>\\w<\/code>, <code>\\s<\/code> \u306a\u3069\u306e\u30b7\u30e7\u30fc\u30c8\u30cf\u30f3\u30c9\u6587\u5b57\u30af\u30e9\u30b9\u3084\u5148\u8aad\u307f\u30fb\u5f8c\u8aad\u307f\u304c\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002\u305f\u3060\u3057\u3001grep -P\u306f\u5b9f\u9a13\u7684\u6a5f\u80fd\u3067\u3042\u308a\u3001\u74b0\u5883\u306b\u3088\u3063\u3066\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># PCRE\u4f7f\u7528\u4f8b\ngrep -P '\\d{3}-\\d{4}' file.txt  # 123-4567 \u306e\u3088\u3046\u306a\u96fb\u8a71\u756a\u53f7\ngrep -P '\\w+@\\w+\\.\\w+' file.txt # \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># PCRE\u4f7f\u7528\u4f8b<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-P<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">\\d{3}-\\d{4}<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><span style=\"color: #BABED8\">  <\/span><span style=\"color: #464B5D; font-style: italic\"># 123-4567 \u306e\u3088\u3046\u306a\u96fb\u8a71\u756a\u53f7<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-P<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">\\w+@\\w+\\.\\w+<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #464B5D; font-style: italic\"># \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. sed\u306e\u57fa\u672c\u3068\u62e1\u5f35\u6b63\u898f\u8868\u73fe<\/strong><\/h3>\n\n\n\n<p>sed\u3067\u306f <code>-E<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3(\u4e00\u90e8\u306e\u74b0\u5883\u3067\u306f <code>-r<\/code>)\u3092\u4f7f\u3063\u3066\u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3092\u6709\u52b9\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># BRE\nsed 's\/\\(abc\\)\\+\/XYZ\/g' file.txt\n\n# ERE  \nsed -E 's\/(abc)+\/XYZ\/g' file.txt\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># BRE<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/\\(abc\\)\\+\/XYZ\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># ERE  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-E<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/(abc)+\/XYZ\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u5b9f\u7528\u4f8b<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>grep\u3067\u306e\u691c\u7d22<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># \u57fa\u672c\u7684\u306a\u691c\u7d22\ngrep 'error' log.txt\n\n# \u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3067\u8907\u6570\u30d1\u30bf\u30fc\u30f3\ngrep -E 'error|warning|fatal' log.txt\n\n# \u884c\u756a\u53f7\u4ed8\u304d\u3067\u8868\u793a\ngrep -n 'error' log.txt\n\n# \u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\ngrep -i 'error' log.txt\n\n# PCRE \u3067\u6570\u5b57\u306e\u307f\u306e\u884c\ngrep -P '^\\d+$' file.txt\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u57fa\u672c\u7684\u306a\u691c\u7d22<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">error<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">log.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3067\u8907\u6570\u30d1\u30bf\u30fc\u30f3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-E<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">error|warning|fatal<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">log.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u884c\u756a\u53f7\u4ed8\u304d\u3067\u8868\u793a<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-n<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">error<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">log.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-i<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">error<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">log.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># PCRE \u3067\u6570\u5b57\u306e\u307f\u306e\u884c<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">grep<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-P<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">^\\d+$<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>sed\u3067\u306e\u7f6e\u63db<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#babed8;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#babed8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># \u57fa\u672c\u7684\u306a\u7f6e\u63db\nsed 's\/old\/new\/' file.txt\n\n# \u3059\u3079\u3066\u7f6e\u63db\nsed 's\/old\/new\/g' file.txt\n\n# \u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u7de8\u96c6\nsed -i 's\/old\/new\/g' file.txt\n\n# \u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528\nsed -E 's\/(&#91;0-9&#93;{4})-(&#91;0-9&#93;{2})-(&#91;0-9&#93;{2})\/\\3\\\/\\2\\\/\\1\/g' file.txt\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-ocean\" style=\"background-color: #0F111A\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u57fa\u672c\u7684\u306a\u7f6e\u63db<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/old\/new\/<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u3059\u3079\u3066\u7f6e\u63db<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/old\/new\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u7de8\u96c6<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-i<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/old\/new\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #464B5D; font-style: italic\"># \u62e1\u5f35\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">sed<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">-E<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #C3E88D\">s\/(&#91;0-9&#93;{4})-(&#91;0-9&#93;{2})-(&#91;0-9&#93;{2})\/\\3\\\/\\2\\\/\\1\/g<\/span><span style=\"color: #89DDFF\">&#39;<\/span><span style=\"color: #BABED8\"> <\/span><span style=\"color: #C3E88D\">file.txt<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\"><strong>\u307e\u3068\u3081<\/strong><\/h2>\n\n\n\n<p>\u57fa\u672c\u6b63\u898f\u8868\u73fe\uff08BRE\uff09\u3068\u62e1\u5f35\u6b63\u898f\u8868\u73fe\uff08ERE\uff09\u3067\u306f\u3001\u7279\u6b8a\u6587\u5b57\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u7570\u306a\u308b\u3068\u3044\u3046\u3053\u3068\u3068\u3001Unicode\u95a2\u9023\u306e\u6a5f\u80fd\u306f\u3059\u3079\u3066\u306e\u30c4\u30fc\u30eb\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001\u4e3b\u306bPerl\u4e92\u63db\u6b63\u898f\u8868\u73fe\uff08PCRE\uff09\u3092\u4f7f\u7528\u3059\u308b\u30c4\u30fc\u30eb\u3067\u306e\u307f\u4f7f\u7528\u53ef\u80fd\u3067\u3042\u308b\u3068\u3044\u3046\u70b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br>\u307e\u305f\u3001\u5229\u7528\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3084\u30c4\u30fc\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u3001\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u6a5f\u80fd\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u6700\u7d42\u7684\u306b\u306f\u81ea\u5206\u306e\u74b0\u5883\u306b\u3042\u3063\u305f\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u666e\u6bb5\u3042\u307e\u308a\u4f7f\u308f\u306a\u3044\u3082\u306e\u306f\u5fd8\u308c\u304c\u3061\u3067\u3001\u63a2\u3059\u306e\u306b\u624b\u9593\u53d6\u308a\u3001\u304b\u3048\u3063\u3066\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u591a\u3005\u306a\u306e\u3067\u3001\u30e1\u30e2\u3068\u3057\u3066\u6b8b\u3057\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux Regular Expression(Regex) Cheat Sheet Linux\u306e\u6b63\u898f\u8868\u73fe\u3092\u30b5\u30af\u3063\u3068\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u53c2\u8003\u306b\u3057\u3066\u3082\u3089\u3048\u308c\u3070\u5e78\u3044\u3067\u3059\u3002 \u7279\u6b8a\u6587\u5b57(\u30e1\u30bf\u6587\u5b57) \u8a18\u53f7 \u8aac\u660e \u4f7f\u7528\u4f8b( [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":558,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"yes","footnotes":""},"categories":[153],"tags":[67,119,118,120,117],"class_list":["post-1420","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux","tag-regex","tag-regular-expression","tag-sed","tag-117"],"_links":{"self":[{"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/1420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/comments?post=1420"}],"version-history":[{"count":30,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/1420\/revisions"}],"predecessor-version":[{"id":2145,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/1420\/revisions\/2145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/media\/558"}],"wp:attachment":[{"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/media?parent=1420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/categories?post=1420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bokumin.org\/blog\/wp-json\/wp\/v2\/tags?post=1420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}