亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ch05_02.htm

?? 編程珍珠,里面很多好用的代碼,大家可以參考學(xué)習(xí)呵呵,
?? HTM
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
We'll discuss the individual pattern-matching operators in a moment,but first we'd like to mention another thing they all have in common,<em class="emphasis">modifiers</em>.</p><p><a name="INDEX-1336"></a><a name="INDEX-1337"></a><a name="INDEX-1338"></a><a name="INDEX-1339"></a>Immediately following the final delimiter of an<tt class="literal">m//</tt>, <tt class="literal">s///</tt>,<tt class="literal">qr//</tt>, or <tt class="literal">tr///</tt> operator, you mayoptionally place one or more single-letter modifiers, in any order.For clarity, modifiers are usually written as "the<tt class="literal">/o</tt> modifier" and pronounced "the slash ohmodifier", even though the final delimiter might be something other than aslash.  (Sometimes people say "flag" or "option" to mean "modifier";that's okay too.)<a name="INDEX-1340"></a><a name="INDEX-1341"></a></p><p>Some modifiers change the behavior of the individual operator, so we'lldescribe those in detail later.  Others change how the regex isinterpreted, so we'll talk about them here.  The <tt class="literal">m//</tt>, <tt class="literal">s///</tt>, and<tt class="literal">qr//</tt> operators<a href="#FOOTNOTE-5">[5]</a> all accept thefollowing modifiers after their final delimiter:</p><blockquote class="footnote"><a name="FOOTNOTE-5"></a><p>[5] The <tt class="literal">tr///</tt> operator does not takeregexes, so these modifiers do not apply.</p></blockquote><a name="perl3-tab-patmods"></a><table border="1"><tr><th>Modifier</th><th>Meaning</th></tr><tr><td><tt class="literal">/i</tt></td><td>Ignore alphabetic case distinctions (case insensitive).<a name="INDEX-1342"></a><a name="INDEX-1343"></a></td></tr><tr><td><tt class="literal">/s</tt></td><td>Let <tt class="literal">.</tt> match newline and ignore deprecated <tt class="literal">$*</tt> variable.<a name="INDEX-1344"></a></td></tr><tr><td><tt class="literal">/m</tt></td><td>Let <tt class="literal">^</tt> and <tt class="literal">$</tt> match next to embedded <tt class="literal">\n</tt>.<a name="INDEX-1345"></a></td></tr><tr><td><tt class="literal">/x</tt></td><td>Ignore (most) whitespace and permit comments in pattern.<a name="INDEX-1346"></a></td></tr><tr><td><tt class="literal">/o</tt></td><td>Compile pattern once only.<a name="INDEX-1347"></a></td></tr></table><p><a name="INDEX-1348"></a>The <tt class="literal">/i</tt> modifier says to match both upper- and lowercase (and titlecase, under Unicode).  That way <tt class="literal">/perl/i</tt> would also match the strings"<tt class="literal">PROPERLY</tt>" or "<tt class="literal">Perlaceous</tt>" (amongst other things).  A <tt class="literal">use locale</tt>pragma may also have some influence on what is considered to be equivalent.(This may be a negative influence on strings containing Unicode.)</p><p><a name="INDEX-1349"></a><a name="INDEX-1350"></a>The <tt class="literal">/s</tt> and <tt class="literal">/m</tt> modifiers don'tinvolve anything kinky.  Rather, they affect how Perl treats matchesagainst a string that contains newlines.  But they aren't aboutwhether your string actually contains newlines; they're about whetherPerl should <em class="emphasis">assume</em> that your string contains asingle line (<tt class="literal">/s</tt>) or multiple lines(<tt class="literal">/m</tt>), because certain metacharacters workdifferently depending on whether they're expected to behave in aline-oriented fashion or not.</p><p><a name="INDEX-1351"></a>Ordinarily, the metacharacter "<tt class="literal">.</tt>" matches any onecharacter <em class="emphasis">except</em> a newline, because itstraditional meaning is to match characters within a line.  With<tt class="literal">/s</tt>, however, the "<tt class="literal">.</tt>"metacharacter can also match a newline, because you've told Perl toignore the fact that the string might contain multiple newlines.  (The<tt class="literal">/s</tt> modifier also makes Perl ignore the deprecated<tt class="literal">$*</tt> variable, which we hope you too have beenignoring.)  The <tt class="literal">/m</tt> modifier, on the other hand,changes the interpretation of the <tt class="literal">^</tt> and<tt class="literal">$</tt> metacharacters by letting them match next tonewlines within the string instead of considering only the ends of thestring.  See the examples in the section <a href="ch05_06.htm#ch05-sect-posit">Section 5.6, "Positions"</a> later in thischapter.</p><p><a name="INDEX-1352"></a><a name="INDEX-1353"></a><a name="INDEX-1354"></a>The <tt class="literal">/o</tt> modifier controls pattern recompilation.Unless the delimiters chosen are single quotes(<tt class="literal">m'</tt><em class="replaceable">PATTERN</em><tt class="literal">'</tt>,<tt class="literal">s'</tt><em class="replaceable">PATTERN</em><tt class="literal">'</tt><em class="replaceable">REPLACEMENT</em><tt class="literal">'</tt>,or<tt class="literal">qr'</tt><em class="replaceable">PATTERN</em><tt class="literal">'</tt>),any variables in the pattern will be interpolated (and may cause thepattern to be recompiled) every time the pattern operator isevaluated.  If you want such a pattern to be compiled once and onlyonce, use the <tt class="literal">/o</tt> modifier.  This prevents expensiverun-time recompilations; it's useful when the value you areinterpolating won't change during execution.  However, mentioning<tt class="literal">/o</tt> constitutes a promise that you won't change thevariables in the pattern.  If you do change them, Perl won't evennotice.  For better control over recompilation, use the<tt class="literal">qr//</tt> regex quoting operator.  See "VariableInterpolation" later in this chapter for details.</p><p><a name="INDEX-1355"></a><a name="INDEX-1356"></a>The <tt class="literal">/x</tt> is the <em class="emphasis">ex</em>pressivemodifier: it allows you to <em class="emphasis">ex</em>ploit whitespace and<em class="emphasis">ex</em>planatory comments in order to<em class="emphasis">ex</em>pand your pattern's legibility, even<em class="emphasis">ex</em>tending the pattern across newlineboundaries.</p><p><a name="INDEX-1357"></a><a name="INDEX-1358"></a>Er, that is to say, <tt class="literal">/x</tt> modifies the meaning of thewhitespace characters (and the <tt class="literal">#</tt> character):instead of letting them do self-matching as ordinary characters do, itturns them into metacharacters that, oddly, now behave as whitespace(and comment characters) should.  Hence, <tt class="literal">/x</tt> allowsspaces, tabs, and newlines for formatting, just like regular Perlcode.  It also allows the <tt class="literal">#</tt> character, not normallyspecial in a pattern, to introduce a comment that extends through theend of the current line within the pattern string.<a href="#FOOTNOTE-6">[6]</a> If you want to match a real whitespacecharacter (or the <tt class="literal">#</tt> character), then you'll have toput it into a character class, or escape it with a backslash, orencode it using an octal or hex escape.  (But whitespace is normallymatched with a <tt class="literal">\s*</tt> or <tt class="literal">\s+</tt>sequence, so the situation doesn't arise often inpractice.)</p><blockquote class="footnote"><a name="FOOTNOTE-6"></a><p>[6] Becareful not to include the pattern delimiter in the comment--becauseof its "find the end first" rule, Perl has no way of knowing youdidn't intend to terminate the pattern at thatpoint.</p></blockquote><p>Taken together, these features go a long way toward making traditionalregular expressions a readable language.  In the spirit of TMTOWTDI,there's now more than one way to write a given regular expression.  Infact, there's more than two ways:<blockquote><pre class="programlisting">m/\w+:(\s+\w+)\s*\d+/;       # A word, colon, space, word, space, digits.m/\w+: (\s+ \w+) \s* \d+/x;  # A word, colon, space, word, space, digits.m{    \w+:                     # Match a word and a colon.    (                        # (begin group)         \s+                 # Match one or more spaces.         \w+                 # Match another word.    )                        # (end group)    \s*                      # Match zero or more spaces.    \d+                      # Match some digits}x;</pre></blockquote><a name="INDEX-1359"></a>We'll explain those new metasymbols later in the chapter.  (Thissection was supposed to be about pattern modifiers, but we've let itget out of hand in our <em class="emphasis">ex</em>citement about <tt class="literal">/x</tt>.  Ah well.)  Here's aregular expression that finds duplicate words in paragraphs, stolenright out of the <em class="citetitle">Perl Cookbook</em>.  It uses the <tt class="literal">/x</tt> and <tt class="literal">/i</tt>modifiers, as well as the <tt class="literal">/g</tt> modifier described later.<blockquote><pre class="programlisting"># Find duplicate words in paragraphs, possibly spanning line boundaries.#   Use /x for space and comments, /i to match both `is'#   in "Is is this ok?", and use /g to find all dups.$/ = "";        # "paragrep" modewhile (&lt;&gt;) {    while ( m{                \b            # start at a word boundary                (\w\S+)       # find a wordish chunk                (                    \s+       # separated by some whitespace                    \1        # and that chunk again                ) +           # repeat ad lib                \b            # until another word boundary             }xig         )    {        print "dup word '$1' at paragraph $.\n";    }}</pre></blockquote>When run on this chapter, it produces warnings like this:<blockquote><pre class="programlisting">dup word 'that' at paragraph 100</pre></blockquote>As it happens, we know that that particular instance was intentional.</p><a name="INDEX-1360"></a><a name="INDEX-1361"></a><a name="INDEX-1362"></a><h3 class="sect2">5.2.2. The m// Operator (Matching)</h3><p><a name="INDEX-1363"></a><blockquote><pre class="programlisting"><em class="replaceable">EXPR</em> =~ m/<em class="replaceable">PATTERN</em>/cgimosx<em class="replaceable">EXPR</em> =~ /<em class="replaceable">PATTERN</em>/cgimosx<em class="replaceable">EXPR</em> =~ ?<em class="replaceable">PATTERN</em>?cgimosxm/<em class="replaceable">PATTERN</em>/cgimosx/<em class="replaceable">PATTERN</em>/cgimosx?<em class="replaceable">PATTERN</em>?cgimosx</pre></blockquote><a name="INDEX-1364"></a>The <tt class="literal">m//</tt> operator searches the string in the scalar <em class="replaceable">EXPR</em> for<em class="replaceable">PATTERN</em>.  If <tt class="literal">/</tt> or <tt class="literal">?</tt> is the delimiter, the initial <tt class="literal">m</tt> isoptional.  Both <tt class="literal">?</tt> and <tt class="literal">'</tt> have special meanings as delimiters: thefirst is a once-only match; the second suppresses variableinterpolation and the six translation escapes (<tt class="literal">\U</tt> and company,described later).</p><p><a name="INDEX-1365"></a>If <em class="replaceable">PATTERN</em> evaluates to a null string,either because you specified it that way using <tt class="literal">//</tt>or because an interpolated variable evaluated to the empty string, thelast successfully executed regular expression not hidden within aninner block (or within a <tt class="literal">split</tt>,<tt class="literal">grep</tt>, or <tt class="literal">map</tt>) is used instead.</p><p><a name="INDEX-1366"></a>In scalar context, the operator returns true (<tt class="literal">1</tt>) if successful,false (<tt class="literal">""</tt>) otherwise.  This form is usually seen in Boolean context:<blockquote><pre class="programlisting">if ($shire =~ m/Baggins/) { ... }  # search for Baggins in $shireif ($shire =~ /Baggins/)  { ... }  # search for Baggins in $shireif ( m#Baggins# )         { ... }  # search right here in $_if ( /Baggins/ )          { ... }  # search right here in $_</pre></blockquote><a name="INDEX-1367"></a><a name="INDEX-1368"></a>Used in list context, <tt class="literal">m//</tt> returns a list ofsubstrings matched by the capturing parentheses in the pattern (thatis, <tt class="literal">$1</tt>, <tt class="literal">$2</tt>,<tt class="literal">$3</tt>, and so on) as described later under "Capturingand Clustering".  The numbered variables are still set even when thelist is returned.  If the match fails in list context, a null list isreturned.  If the match succeeds in list context but there were nocapturing parentheses (nor <tt class="literal">/g</tt>), a list value of<tt class="literal">(1)</tt> is returned.  Since it returns a null list onfailure, this form of <tt class="literal">m//</tt> can also be used inBoolean context, but only when participating indirectly via a listassignment:<blockquote><pre class="programlisting">if (($key,$value) = /(\w+): (.*)/) { ... }</pre></blockquote>Valid modifiers for <tt class="literal">m//</tt> (in whatever guise) areshown in <a href="ch05_02.htm#perl3-tab-mmods">Table 5-1</a>.<a name="INDEX-1369"></a><a name="INDEX-1370"></a></p><a name="perl3-tab-mmods"></a><h4 class="objtitle">Table 5.1. m// Modifiers</h4><table border="1"><tr><th>Modifier</th><th>Meaning</th></tr><tr><td><tt class="literal">/i</tt><a name="INDEX-1371"></a></td><td>Ignore alphabetic case.</td></tr><tr><td><tt class="literal">/m</tt><a name="INDEX-1372"></a></td><td>Let <tt class="literal">^</tt> and <tt class="literal">$</tt> match next to embedded <tt class="literal">\n</tt>.<a name="INDEX-1373"></a><a name="INDEX-1374"></a></td></tr><tr><td><tt class="literal">/s</tt></td><td>Let <tt class="literal">.</tt> match newline and ignore deprecated <tt class="literal">$*</tt>.<a name="INDEX-1375"></a></td></tr>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av一区二区| 精品1区2区在线观看| 91麻豆免费看片| 国产成人精品三级麻豆| 狠狠色狠狠色综合系列| 精品在线免费观看| 久久成人免费日本黄色| 精油按摩中文字幕久久| 国产在线精品一区二区夜色 | 久久99久久99| 免费高清在线视频一区·| 日韩av不卡一区二区| 日本午夜一本久久久综合| 蜜臀av一区二区三区| 国产一区视频导航| 国产风韵犹存在线视精品| 不卡在线视频中文字幕| 日本高清无吗v一区| 欧美日韩国产一级二级| 精品欧美乱码久久久久久| 国产亚洲欧洲997久久综合 | 一区二区三区精品在线观看| 亚洲已满18点击进入久久| 亚洲国产综合91精品麻豆 | 欧美伦理视频网站| 日韩你懂的电影在线观看| 久久精品亚洲精品国产欧美kt∨| 国产欧美精品国产国产专区| 一区二区视频在线看| 午夜精品影院在线观看| 精品在线亚洲视频| 99精品视频在线观看免费| 欧美日韩一区国产| 久久伊人蜜桃av一区二区| 日韩美女视频一区| 日韩电影网1区2区| 粉嫩绯色av一区二区在线观看| 色偷偷88欧美精品久久久| 337p亚洲精品色噜噜噜| 国产精品网站一区| 亚洲动漫第一页| 国产美女一区二区三区| 欧日韩精品视频| 精品乱人伦小说| 亚洲美女免费在线| 麻豆国产精品一区二区三区| 成人黄色网址在线观看| 欧美喷水一区二区| 国产亚洲一本大道中文在线| 亚洲小说春色综合另类电影| 国模无码大尺度一区二区三区| 91丨porny丨国产| 日韩午夜激情免费电影| 亚洲精品网站在线观看| 狠狠色2019综合网| 欧洲一区在线电影| 国产欧美一区二区在线| 天堂影院一区二区| 97久久超碰国产精品电影| 欧美电影免费提供在线观看| 一区二区三区在线免费| 国产精品1024| 欧美高清视频一二三区 | 亚洲免费在线视频一区 二区| 91网站视频在线观看| 26uuu亚洲综合色| 亚洲午夜激情网页| 99在线精品免费| 欧美变态口味重另类| 亚洲午夜视频在线| av一二三不卡影片| 久久精品人人做| 日韩黄色免费网站| 色悠悠久久综合| 国产欧美日韩另类一区| 免费在线看一区| 欧美日韩极品在线观看一区| 国产精品传媒入口麻豆| 国产乱子伦一区二区三区国色天香| 欧美日韩成人在线| 亚洲欧洲在线观看av| 国产精品一区二区无线| 日韩欧美一级特黄在线播放| 亚洲成av人片一区二区梦乃| 91麻豆国产精品久久| 国产欧美一区二区精品忘忧草| 青娱乐精品视频在线| 欧美日本免费一区二区三区| 夜夜嗨av一区二区三区中文字幕| 91啪亚洲精品| ...av二区三区久久精品| 国产很黄免费观看久久| 久久新电视剧免费观看| 94-欧美-setu| 国产精品一区二区在线观看网站| 高清不卡在线观看| 久久精品亚洲精品国产欧美kt∨| 精品一区二区三区蜜桃| 欧美本精品男人aⅴ天堂| 美女爽到高潮91| 欧美大片一区二区| 九九国产精品视频| 精品盗摄一区二区三区| 国内精品久久久久影院色| 精品久久久久香蕉网| 国内精品久久久久影院一蜜桃| 久久人人爽爽爽人久久久| 国产一区二区日韩精品| 国产亚洲精品精华液| 国产福利不卡视频| 国产精品天干天干在线综合| 不卡一区在线观看| 亚洲品质自拍视频| 在线观看三级视频欧美| 五月天激情小说综合| 在线播放欧美女士性生活| 日本女人一区二区三区| 精品精品欲导航| 国产精品一区二区久久精品爱涩| 国产欧美日韩在线看| 丁香六月久久综合狠狠色| 国产精品成人一区二区艾草| 一本大道久久a久久精品综合| 亚洲另类在线制服丝袜| 欧美综合久久久| 男女男精品视频| 久久一日本道色综合| a4yy欧美一区二区三区| 亚洲精品成人天堂一二三| 欧美日韩一区不卡| 久久av中文字幕片| 国产日韩亚洲欧美综合| 99re视频精品| 天堂成人国产精品一区| 久久只精品国产| 91美女福利视频| 免费高清视频精品| 国产精品欧美一区喷水| 欧美中文字幕亚洲一区二区va在线| 日韩和的一区二区| 日本一区二区免费在线观看视频| 99久久99久久综合| 日本免费在线视频不卡一不卡二| 久久香蕉国产线看观看99| 91在线观看高清| 蜜桃久久精品一区二区| 中文字幕日本不卡| 日韩一区二区三区视频在线观看| 国产高清不卡一区| 午夜精品福利在线| 国产日韩欧美一区二区三区综合 | 日韩一本二本av| 成人性视频免费网站| 亚洲成人av一区| 国产欧美精品一区二区色综合 | 一区二区三区中文字幕精品精品 | 国产一区二区看久久| 亚洲欧美经典视频| 精品少妇一区二区三区在线播放| 97精品电影院| 激情综合网最新| 艳妇臀荡乳欲伦亚洲一区| 亚洲精品在线免费播放| 欧美在线免费视屏| 成人一二三区视频| 日本强好片久久久久久aaa| 国产精品色在线| 欧美一区在线视频| 99精品黄色片免费大全| 久久精品99久久久| 亚洲女人****多毛耸耸8| 精品久久国产字幕高潮| 欧亚洲嫩模精品一区三区| 岛国一区二区在线观看| 捆绑调教美女网站视频一区| 亚洲综合色视频| 亚洲欧洲av另类| 久久综合九色综合97_久久久| 欧美特级限制片免费在线观看| 高清视频一区二区| 久久99精品久久久久久国产越南 | 国产在线视频一区二区| 肉色丝袜一区二区| 亚洲已满18点击进入久久| 国产精品女上位| 久久久不卡网国产精品二区| 在线综合亚洲欧美在线视频| 欧美性感一类影片在线播放| 成人国产在线观看| 国产夫妻精品视频| 国产曰批免费观看久久久| 日精品一区二区| 亚洲国产精品精华液网站| 亚洲私人影院在线观看| 国产性天天综合网| 日韩精品一区二区在线| 制服丝袜激情欧洲亚洲| 欧美日韩aaaaa| 欧美伊人久久久久久午夜久久久久| 99久久精品国产网站|