Re: Regular expressions

From: Date: Wed, 15 Nov 2006 12:09:27 +0000
Subject: Re: Regular expressions
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-244654@lists.php.net to get a copy of this message
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.

« previous php.general (#244654) next »