help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: regular expression


From: Teemu Likonen
Subject: Re: regular expression
Date: Mon, 30 Jun 2014 23:36:22 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

Emanuel Berg [2014-06-30 22:13:09 +02:00] wrote:

> Emanuel Berg <embe8573@student.uu.se> writes:
>> Note that [A-Z] matches [a-z] as well (the lowercase equivalent)
>> unless the variable case-fold-search is nil.
>
> It seems this isn't so. Well, all the better as it is less confusing.
> [A-Za-z] is all the a-z chars in both upper- and lowercase, and [A-Z]
> isn't [a-z].

It's very likely that when one writes [A-Za-z] he actually means "match
any letter". So it's often better to write [[:alpha:]] instead since it
also matches other letters than A-Z. Sometimes a good option is \w which
matches word-constituent characters as defined in the current syntax
table.

Attachment: signature.asc
Description: PGP signature


reply via email to

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