摘要:
$identify 的 “identify” 表示一个Perl标识符,即 identifier 阅读全文
摘要:
#! /usr/bin/perl use strict; use warnings;#my @strict_pragma = qw ( a b c);#print $strict_pragma[0];print "\n _delimiter_match_http:// \n";$_ = "https 阅读全文
摘要:
#! /usr/bin/perl use strict; use warnings;print "\n simple_pattern_metacharacter_quantifier \n";$_ = "asteriskasterisk hash access unpack_func";for (/ 阅读全文
摘要:
#! /usr/bin/perl use strict; use warnings;print "\n _substitutions_with_s/// \n";$_ = "He's out bowling with Barney tonight.";s/Barney/Fred/;print $_. 阅读全文
摘要:
先行断言: /a(?=b)/ ,positive lookahead,a的后方必须是b才行 /a(?!b)/ ,negative lookahead,a的后方必须不是b才能匹配 如下图示: 来自:https://regexper.com/#%2F%5Cd%28%3F%3D%5BAB%5D%29%2F 阅读全文
摘要:
Regex of Perl: ?= 指的是如果后面匹配到,则后面的内容不做替换,保留。 ab, s/a?=b/x/,变为xb,即后面匹配到b,b保留不做替换 阅读全文