Re: Regular expressions

From: Date: Tue, 21 Nov 2006 21:23:57 +0000
Subject: Re: Regular expressions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-244995@lists.php.net to get a copy of this message
On Tue, November 14, 2006 7:57 pm, John Meyer wrote: Is there a way to make a regular expression to match on a particular way the letters are arranged? For instance, if you had a word: THAT It could match on any word in the dictionary that had the form: 1231
At 11/21/2006 11:07 AM, Richard Lynch wrote:
For any word with more then 9 unique characters, you are going to have SERIOUS problems... Consider this: supercalifragilisticexpialidocious 123456789105711989... How can you tell that '11' for the 'g' isn't supposed to be '1' followed by '1' for two 's' characters in a row? supercalifrassilisticexpialidocious 123456789105711989... You may need to represent your digits in, say, hex form, or even in base 26 form, which gives you the full alphabet as unique digits.
I agree that, of the many ways to encode this, using single ASCII digits would be one of the poorest. One rather obvious cypher would be the alphabet itself -- a set of one-character symbols of precisely the same number as the characters you want to encode: php ABA that ABCA whew ABCA supercalifragilisticexpialidocious ABCDEFGHIJEGKIHIALIFDMCIGHINOFIOBA Regards, Abcd

« previous php.general (#244995) next »