chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] How to search UTF-8 multibyte characters with regex?


From: Christian Kellermann
Subject: Re: [Chicken-users] How to search UTF-8 multibyte characters with regex?
Date: Thu, 9 Nov 2017 09:19:00 +0100
User-agent: Mutt/1.9.1 (2017-09-22)

* Chunyang Xu <address@hidden> [171109 05:42]:
> Hello list,
> 
> I'm new to Chicken Scheme. I need to check if a string contains some
> multibyte characters. In Emacs Lisp, I use:
> 
> (string-match "[??????]" "??????")
>      => nil
> 
> (string-match "[??????]" "????????????")
>      => 2
> 
> and it works fine, however, the following Chicken code doesn't:
> 
> (irregex-search "[??????]" "??????")
>      => #<regexp-match (0 submatches)>
> 
> I expect it to return #f since "??????" doesn't contain "???" or "???".
> 
> Any tips?

Did you load the utf8 egg?

# chicken-install utf8

Then in your code (use utf8).

http://api.call-cc.org/doc/utf8

This includes string-match that is unicode aware.

Kind regards,

Christian

-- 
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]