Thanks Keisuke, that looks like an acceptable solution for James I hope. The 
only comment I have is whether:

$regex:="[:^ascii:]"

should actually be:

$regex:="[[:^ascii:]]"

Since although 4D is accepting the first version, when I tested this with 
https://regex101.com it complained that "A posix character class may only 
appear inside a character class" which is explained here, 
https://www.regular-expressions.info/posixbrackets.html

Regards,
 
Narinder Chandi,
ToolBox Systems Ltd.
-- 

-----Original Message-----
From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech Mailing List 
<4d_tech@lists.4d.com>
Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Date: Thursday, 13 June 2019 at 01:41
To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Cc: Keisuke Miyako <keisuke.miy...@4d.com>
Subject: Re: Emojis in text

    according to
    
    https://unicode.org/reports/tr51/#Property_Stability
    
    an Emoji is
    
      \p{RI} \p{RI}
    | \p{Emoji}
      ( \p{EMod}
        | \x{FE0F} \x{20E3}?
        | [\x{E0020}-\x{E007E}]+ \x{E007F} )?
      (\x{200D} \p{Emoji}
        ( \p{EMod}
          | \x{FE0F} \x{20E3}? )?)+
    
    no kidding.
    
    but the ICU in 4D does not support the [:Emoji:] or \p{Emoji} property.
    
    ---
    
    that said, if you just want to filter non-ASCII, for example, it could be 
as simple as
    
    $text:="I an unwell 😷 cough cough😭"
    
    $regex:="[:^ascii:]"
    
    While (Match regex($regex;$text;1;$pos;$len))
    $text:=Delete string($text;$pos;$len)
    End while
    
    
    
    **********************************************************************
    4D Internet Users Group (4D iNUG)
    Archive:  http://lists.4d.com/archives.html
    Options: https://lists.4d.com/mailman/options/4d_tech
    Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
    **********************************************************************


**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to