Regular expression: Difference between revisions

Jump to navigation Jump to search
328 bytes removed ,  10 December 2025
Line 187: Line 187:
=== Find Non-ASCII Characters (Chinese/Non-English Text) ===
=== Find Non-ASCII Characters (Chinese/Non-English Text) ===


<span id="in-google-sheets"></span>
==== In Google Sheets ====


<pre>[^\x00-\x80]+</pre>
<span id="in-libreoffice"></span>
==== In LibreOffice ====
==== In LibreOffice ====


<pre>[^\u0000-\u0080]+</pre>
<pre>[^\u0000-\u0080]+</pre>
<span id="find-chinese-characters-in-google-sheets"></span>
 
 
==== Find Chinese Characters in Google Sheets ====
==== Find Chinese Characters in Google Sheets ====


Line 201: Line 198:


<pre>=IF(REGEXMATCH(A2, &quot;[\一-\龥]&quot;), &quot;Chinese&quot;, &quot;English&quot;)</pre>
<pre>=IF(REGEXMATCH(A2, &quot;[\一-\龥]&quot;), &quot;Chinese&quot;, &quot;English&quot;)</pre>
<span id="find-chinese-characters-in-mysql"></span>


==== Find Non-ASCII Characters in Google Sheets ====
==== Find Non-ASCII Characters in Google Sheets ====
Line 243: Line 239:
FROM `table_name`
FROM `table_name`
WHERE `column_name` <> CONVERT(`column_name` USING ASCII)</syntaxhighlight>
WHERE `column_name` <> CONVERT(`column_name` USING ASCII)</syntaxhighlight>
<span id="find-chinese-characters-in-php"></span>
 
==== Find Chinese Characters in PHP ====
==== Find Chinese Characters in PHP ====


Line 274: Line 270:
preg_match_all($pattern, $string, $matches, PREG_OFFSET_CAPTURE);
preg_match_all($pattern, $string, $matches, PREG_OFFSET_CAPTURE);
var_dump($matches);</syntaxhighlight>
var_dump($matches);</syntaxhighlight>
<span id="find-ascii-characters-in-php"></span>
 
=== Find ASCII Characters in PHP ===
=== Find ASCII Characters in PHP ===


Navigation menu