Regular expression: Difference between revisions
Jump to navigation
Jump to search
→Find non-ASCII characters 尋找中文、非英文的文字
| Line 374: | Line 374: | ||
</pre> | </pre> | ||
==== 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> | ||
[^\u0000-\u0080]+ | |||
</pre> | </pre> | ||
==== Find | ==== Find Chinese characters in Google sheet ==== | ||
範例:如果 A2 包含任一中文字,則欄位值顯示「中文」。如果未包含任何中文字,則欄位值顯示「英文」。 {{exclaim}} Google 不支援以下語法 {{kbd | key=<nowiki>[\u4e00-\u9fa5]</nowiki>}} | |||
<pre> | <pre> | ||
[ | =IF(REGEXMATCH(A2, "[\一-\龥]"), "中文", "英文") | ||
</pre> | </pre> | ||
==== Find | ==== 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> | ||
==== | ==== Find non-ASCII characters in MySQL ==== | ||
尋找 `column_name` 欄位值不完全是 ASCII 字元 | 尋找 `column_name` 欄位值不完全是 ASCII 字元 | ||
<pre> | <pre> | ||