[erlang-questions] regexp module

Tim Bray Tim.Bray@REDACTED
Wed Oct 10 19:57:13 CEST 2007


On Oct 10, 2007, at 3:18 AM, Liam Clarke wrote:

> Hi all,
>
> Quick question, is there a way to do case insensitive matches with the
> regexp module? I've hacked together a function to lower case
> everything and go from there, but I just got that 'reinventing the
> wheel' feeling that I get when in the early stages of familiarity with
> a language and its libraries.

If you're going to have to handle internationalized text in the  
general case, it's probably better to stay away from case-folding.   
The rules are incredibly locale-sensitive and language-sensitive.   
The java.String.toLower() call is insanely slow because it tries to  
deal with all these corner cases.  If you're in ASCII, you're OK, but  
even ISO-Latin-1 gets into trouble?  For example, what's the lower- 
case of "I"?  It's different in Turkey.  -Tim





More information about the erlang-questions mailing list