[Tutor] re syntax

Kent Johnson kent37 at tds.net
Mon Aug 28 20:54:52 CEST 2006


Tiago Saboga wrote:
> Em Segunda 28 Agosto 2006 11:12, Kent Johnson escreveu:
>   
>> Ahem. Which part of "Whitespace within the pattern is ignored" do you
>> not understand? :-)
>>     
>
> It's easy ;-) It's the "whitespace" part. I read it as the space character, 
> not as any blank character. I should have noted that new lines are ignored 
> too, but I didn't. 
>
> (I just looked a little around in my system and it seems like it's not just my 
> own opinion, the ascii(7), regex(7) and wctype(3) man pages talk about spaces 
> and blank characters, and the latter means what is meant by "whitespace" in 
> python docs).

A 'space character' is the single character \x20. A 'whitespace 
character' is any character in a some set of non-printing (white) 
characters. I guess it is a subtle distinction but it's common usage, 
not just Python; it even has a Wikipedia entry:
http://en.wikipedia.org/wiki/Whitespace_%28computer_science%29

(Not to be confused with Whitespace the programming language, in which 
all *non* white space characters are ignored:
http://en.wikipedia.org/wiki/Whitespace_programming_language :-))

Kent



More information about the Tutor mailing list