久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <legend id='Ownxs'><style id='Ownxs'><dir id='Ownxs'><q id='Ownxs'></q></dir></style></legend>
    1. <small id='Ownxs'></small><noframes id='Ownxs'>

      1. <i id='Ownxs'><tr id='Ownxs'><dt id='Ownxs'><q id='Ownxs'><span id='Ownxs'><b id='Ownxs'><form id='Ownxs'><ins id='Ownxs'></ins><ul id='Ownxs'></ul><sub id='Ownxs'></sub></form><legend id='Ownxs'></legend><bdo id='Ownxs'><pre id='Ownxs'><center id='Ownxs'></center></pre></bdo></b><th id='Ownxs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ownxs'><tfoot id='Ownxs'></tfoot><dl id='Ownxs'><fieldset id='Ownxs'></fieldset></dl></div>

        <tfoot id='Ownxs'></tfoot>

          <bdo id='Ownxs'></bdo><ul id='Ownxs'></ul>
      2. utf-8中的php正則表達式單詞邊界匹配

        php regex word boundary matching in utf-8(utf-8中的php正則表達式單詞邊界匹配)

          <bdo id='MqELo'></bdo><ul id='MqELo'></ul>

            <small id='MqELo'></small><noframes id='MqELo'>

            <tfoot id='MqELo'></tfoot>
          1. <legend id='MqELo'><style id='MqELo'><dir id='MqELo'><q id='MqELo'></q></dir></style></legend>
                  <tbody id='MqELo'></tbody>
                • <i id='MqELo'><tr id='MqELo'><dt id='MqELo'><q id='MqELo'><span id='MqELo'><b id='MqELo'><form id='MqELo'><ins id='MqELo'></ins><ul id='MqELo'></ul><sub id='MqELo'></sub></form><legend id='MqELo'></legend><bdo id='MqELo'><pre id='MqELo'><center id='MqELo'></center></pre></bdo></b><th id='MqELo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MqELo'><tfoot id='MqELo'></tfoot><dl id='MqELo'><fieldset id='MqELo'></fieldset></dl></div>
                  本文介紹了utf-8中的php正則表達式單詞邊界匹配的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在 utf-8 php 文件中有以下 php 代碼:

                  I have the following php code in a utf-8 php file:

                  var_dump(setlocale(LC_CTYPE, 'de_DE.utf8', 'German_Germany.utf-8', 'de_DE', 'german'));
                  var_dump(mb_internal_encoding());
                  var_dump(mb_internal_encoding('utf-8'));
                  var_dump(mb_internal_encoding());
                  var_dump(mb_regex_encoding());
                  var_dump(mb_regex_encoding('utf-8'));
                  var_dump(mb_regex_encoding());
                  var_dump(preg_replace('/wei?/iu', 'weiss', 'wei?bier'));
                  

                  我希望最后一個正則表達式只替換完整的單詞而不是部分單詞.

                  I would like the last regex to replace only full words and not parts of words.

                  在我的 Windows 計算機上,它返回:

                  On my windows computer, it returns:

                  string 'German_Germany.1252' (length=19)
                  string 'ISO-8859-1' (length=10)
                  boolean true
                  string 'UTF-8' (length=5)
                  string 'EUC-JP' (length=6)
                  boolean true
                  string 'UTF-8' (length=5)
                  string 'wei?bier' (length=9)
                  

                  在網絡服務器 (linux) 上,我得到:

                  On the webserver (linux), I get:

                  string(10) "de_DE.utf8"
                  string(10) "ISO-8859-1"
                  bool(true)
                  string(5) "UTF-8"
                  string(10) "ISO-8859-1"
                  bool(true)
                  string(5) "UTF-8"
                  string(9) "weissbier"
                  

                  因此,正則表達式在 Windows 上按我的預期工作,但在 linux 上卻沒有.

                  Thus, the regex works as I expected on windows but not on linux.

                  所以主要問題是,我應該如何編寫我的正則表達式以僅匹配單詞邊界?

                  So the main question is, how should I write my regex to only match at word boundaries?

                  第二個問題是如何讓 windows 知道我想在我的 php 應用程序中使用 utf-8.

                  A secondary questions is how I can let windows know that I want to use utf-8 in my php application.

                  推薦答案

                  即使在 UTF-8 模式下,像 w 這樣的標準類簡寫也不是 Unicode-知道的.您只需要使用 Unicode 速記,正如您所研究的那樣,但是您可以通過使用環顧而不是交替來使它不那么難看:

                  Even in UTF-8 mode, standard class shorthands like w and  are not Unicode-aware. You just have to use the Unicode shorthands, as you worked out, but you can make it a little less ugly by using lookarounds instead of alternations:

                  /(?<!pL)wei?(?!pL)/u
                  

                  還要注意我是如何將花括號從 Unicode 類速記中去掉的;當類名由單個字母組成時,您可以這樣做.

                  Notice also how I left the curly braces out of the Unicode class shorthands; you can do that when the class name consists of a single letter.

                  這篇關于utf-8中的php正則表達式單詞邊界匹配的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                  <legend id='v1T3z'><style id='v1T3z'><dir id='v1T3z'><q id='v1T3z'></q></dir></style></legend>

                    <bdo id='v1T3z'></bdo><ul id='v1T3z'></ul>

                      <small id='v1T3z'></small><noframes id='v1T3z'>

                      <i id='v1T3z'><tr id='v1T3z'><dt id='v1T3z'><q id='v1T3z'><span id='v1T3z'><b id='v1T3z'><form id='v1T3z'><ins id='v1T3z'></ins><ul id='v1T3z'></ul><sub id='v1T3z'></sub></form><legend id='v1T3z'></legend><bdo id='v1T3z'><pre id='v1T3z'><center id='v1T3z'></center></pre></bdo></b><th id='v1T3z'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='v1T3z'><tfoot id='v1T3z'></tfoot><dl id='v1T3z'><fieldset id='v1T3z'></fieldset></dl></div>
                          • <tfoot id='v1T3z'></tfoot>

                              <tbody id='v1T3z'></tbody>
                            主站蜘蛛池模板: 综合精品久久久 | 国产精品美女一区二区三区 | 91九色在线观看 | 在线中文一区 | 99免费看| 久久丝袜 | 久久99视频免费观看 | 国产精品免费一区二区三区四区 | 日韩精品一区中文字幕 | 精品国产乱码一区二区三 | 国产精品视频一区二区三区四蜜臂 | 97久久国产| 欧美午夜影院 | 99热这里有精品 | 中文在线www | 国产成人艳妇aa视频在线 | 伊人影院99| www.青青草 | 国产日产精品一区二区三区四区 | 久久99视频精品 | 成人a免费| 一级毛片色一级 | 欧美久久久电影 | 国产伦精品一区二区三区精品视频 | 中文字幕一区二区三区不卡 | 狠狠艹| 国产一区二区三区精品久久久 | 亚洲一区视频 | 亚洲精品2区 | 青青草久久 | 国产精品久久av | 日本成人中文字幕 | 日本aaaa | 一级免费毛片 | 久久精品中文 | 日韩色视频 | 超碰在线97国产 | 久草热在线 | 美女激情av | 天天干天天干 | 国产精品久久久久久久久久久久冷 |