Regular expression: Difference between revisions

Jump to navigation Jump to search
Line 374: Line 374:
</pre>
</pre>


範例:如果 A2 包含任一中文字,則欄位值顯示「中文」。如果未包含任何中文字,則欄位值顯示「英文」。 {{exclaim}} Google 不支援以下語法 {{kbd | key=<nowiki>[\u4e00-\u9fa5]</nowiki>}}
==== Find non-ASCII characters in LibreOffice ====
適用: [https://zh-tw.libreoffice.org/ LibreOffice] [https://help.libreoffice.org/6.2/en-US/text/scalc/01/func_regex.html REGEX] function<ref>[https://help.libreoffice.org/6.2/en-US/text/shared/01/02100001.html?&DbPAR=WRITER&System=MAC List of Regular Expressions]</ref>、Total commander 的 Multi-Rename tool<ref>取代非英文的文字,但是不包含 . 符號: <nowiki>[^\u0000-\u0080|.]+ </nowiki></ref><ref>[http://stackoverflow.com/questions/150033/regular-expression-to-match-non-english-characters javascript - Regular expression to match non-english characters? - Stack Overflow]</ref>
<pre>
<pre>
=IF(REGEXMATCH(A2, "[\-\]"), "中文", "英文")
[^\u0000-\u0080]+
</pre>
</pre>


==== Find non-ASCII characters in LibreOffice ====
==== Find Chinese characters in Google sheet ====
適用: [https://zh-tw.libreoffice.org/ LibreOffice] [https://help.libreoffice.org/6.2/en-US/text/scalc/01/func_regex.html REGEX] function<ref>[https://help.libreoffice.org/6.2/en-US/text/shared/01/02100001.html?&DbPAR=WRITER&System=MAC List of Regular Expressions]</ref>、Total commander 的 Multi-Rename tool<ref>取代非英文的文字,但是不包含 . 符號: <nowiki>[^\u0000-\u0080|.]+ </nowiki></ref><ref>[http://stackoverflow.com/questions/150033/regular-expression-to-match-non-english-characters javascript - Regular expression to match non-english characters? - Stack Overflow]</ref>
範例:如果 A2 包含任一中文字,則欄位值顯示「中文」。如果未包含任何中文字,則欄位值顯示「英文」。 {{exclaim}} Google 不支援以下語法 {{kbd | key=<nowiki>[\u4e00-\u9fa5]</nowiki>}}
<pre>
<pre>
[^\u0000-\u0080]+
=IF(REGEXMATCH(A2, "[\-\]"), "中文", "英文")
</pre>
</pre>


==== Find non-ASCII characters in MySQL ====
==== Find Chinese characters in MySQL ====
===== 尋找欄位值包含中文字 =====
尋找 `column_name` 欄位值包含中文字。適用: MySQL<ref>[https://stackoverflow.com/questions/9795137/how-to-detect-rows-with-chinese-characters-in-mysql How to detect rows with chinese characters in MySQL? - Stack Overflow]</ref><ref>[https://stackoverflow.com/questions/401771/how-can-i-find-non-ascii-characters-in-mysql How can I find non-ASCII characters in MySQL? - Stack Overflow]</ref>
尋找 `column_name` 欄位值包含中文字。適用: MySQL<ref>[https://stackoverflow.com/questions/9795137/how-to-detect-rows-with-chinese-characters-in-mysql How to detect rows with chinese characters in MySQL? - Stack Overflow]</ref><ref>[https://stackoverflow.com/questions/401771/how-can-i-find-non-ascii-characters-in-mysql How can I find non-ASCII characters in MySQL? - Stack Overflow]</ref>
<pre>
<pre>
Line 400: Line 400:
</pre>
</pre>


===== 尋找欄位值不完全是 ASCII 字元 =====
==== Find non-ASCII characters in MySQL ====
尋找 `column_name` 欄位值不完全是 ASCII 字元
尋找 `column_name` 欄位值不完全是 ASCII 字元
<pre>
<pre>
Anonymous user

Navigation menu