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

Re: OT: regular expression question



On Fri, Dec 08, 2000 at 11:16:11AM -0700, Hubert Chan wrote:
> It all depends on what you mean when you say "word".  I used it in the abstract
> sense, which is just a string of characters.  So abcba is a word, even though
> it is not an English word.
> 
> Strictly, "A Man, a Plan, a Canal, Panama" is not a palindrome if you're
> talking about abstract words, because of commas and spaces, but
> "amanaplanacanalpanama" is.  (And "amanaplanacanalpanama" is also a word in the
> abstract sense.)  But if you want to treat spaces, punctuation, and
> capitalization as irrelevant decorations, then you could say that "A Man, a
> Plan, a Canal, Panama" is the same as "amanaplanacanalpanama" and is a
> palindrome.

Yes, but the definition of palindrome according to two English
language references (Webster's, Oxford Companion) say they can be words,
sentences or verse and allthough neither are clear about punctuation and
capitalization, the're are examples that ignore these things.  I'd
hardly call spaces, punctuation and capitalization "irrelevant
decorations".  I only made the mention because identifying a palindrome
involves *more* than just determining if a sequence of characters is the
same in forward and reverse (since people don't seem to strictly adhere
to that idea in practice).

-- 
Eric G. Miller <egm2@jps.net>



Reply to: