This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

accent

Old posts that have not been replied to for several years.
Locked
a
agoni

Post by agoni »

hi everybody.

My question is about a game (wordgame). Some answers come with accents. Is there a way to accept the answer even if the accent are not correctly done. ?

excuse my english :-/

exemple :
the answer is "élise"
i would like that "èlise" or "elise" would be accepted.

anyone have a suggestion? thank you for help :smile:

User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Use regular expressions, and make the answer mask like this:

(é|è|e)lise

A rougher way of doing it is to substitute the non-accented letter for the accented one:

# User's guess
set guess "èlïse"

regsub -all è|é|ê|ë $guess e guess
regsub -all ì|í|î|ï $guess i guess
regsub -all ò|ó|ô|õ|ö $guess o guess
regsub -all à|á|â|ã|ä|å|æ $guess a guess
# now guess doesn't have those accents..
# do the same for the other accents
a
agoni

Post by agoni »

thank you very much stdragon!
Locked