<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                | 字符 | 功能 | | --- | --- | |` |` | 匹配左右任意一個表達式 | | `(ab)` | 將括號中字符作為一個分組 | | `\num` | 引用分組num匹配到的字符串 | | `(?p<name>)` | 分組起別名 | | `(?P=name)` | 引用別名為name分組匹配到的字符串 | ~~~ # 匹配0-100的數字 # 0 10 11 12 13 20 30 40 100 # 1 re.match(r"[1-9]\d?$|0$|100$", "200") # 2 精簡 re.match(r"[1-9]?\d?$|100$", "0") ~~~ ~~~ # 匹配路徑 # file:///C:/Users/Administrator/Desktop//courseware/section.4.html re.match(r"", "") ~~~ ~~~ # 提取匹配內容 group,groups >>> result = re.match(r"(<h1>).*(</h1>)", "<h1>匹配分組</h1>") >>> result.group() '<h1>匹配分組</h1>' >>> result.group(1) '<h1>' >>> result.group(2) '</h1>' >>> result.groups() ('<h1>', '</h1>') >>> result.groups()[0] '<h1>' >>> result.groups()[1] '</h1>' ~~~ ~~~ # 分組引用匹配 >>> s = "<html><h1>haibo</h1></html>" >>> result = re.match(r"<(.+)><(.+)>.+</\2></\1>", s) >>> result.group() '<html><h1>haibo</h1></html>' >>> result.groups(1) ('html', 'h1') >>> result.groups(2) ('html', 'h1') ~~~ ~~~ # 分組別名匹配 >>> s = "<html><h1>haibo</h1></html>" >>> re.match(r"<(?P<haibo1>.+)><(?P<haibo2>.+)>.+</(?P=haibo2)></(?P=haibo1)>", s) <_sre.SRE_Match object; span=(0, 27), match='<html><h1>haibo</h1></html>'> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看