Re: Regular expressions

From: Date: Wed, 15 Nov 2006 12:19:48 +0000
Subject: Re: Regular expressions
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-244656@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Okay, what I am referring to is cryptograms, where one letter is substituted for another. I would like to be able to list all the words in a dictionary that have that arrangement of their letters. Later on, I would like to be able to do an entire cryptogram that way. Dave Goodchild 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 > > preg_,match('/^(\w){1}\w\w\1$/'); > > would match the above on a single line for example, where \1 refers to > the pattern captured in parentheses at the start. > > Try and be a little more specific in what you want to match, as regex is > hard enough to start with - a detailed and clear description will elicit > corresponding responses. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFFWwXkbHd4gglFmoARAooyAJ0S8R3JkLApczGxBA9FrOQQMZSGvwCgmNUX C9idJue2LWK1EL6gO6qttjg= =IqlT -----END PGP SIGNATURE-----

« previous php.general (#244656) next »