MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: and a type of regular expression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109703] Re: and a type of regular expression
  • From: Michael Stern <nycstern at gmail.com>
  • Date: Wed, 12 May 2010 07:35:35 -0400 (EDT)

You are my hero.

Michael



David Bevan wrote:
> RegularExpression["d.(.)\\1.k"]
>
> does what you want using a regex.
>
> David %^>
>
>
>   
>> On 5/9/10 at 7:51 AM, nycstern at gmail.com (Michael Stern) wrote:
>>
>>     
>>> Is there an elegant way to do dictionary searches that match
>>> specified kinds of character repetition? For example, to search for
>>> six letter words that start with "d" and end with "k", where the
>>> third and fourth letter are the same?
>>>       
>>> Finding six letter words that start with "d" and end with "k" is
>>> easy --
>>>       
>>> DictionaryLookup[{"English", RegularExpression["d....k"]}]
>>>       
>>> But how do we restrict the answer to words where the third and
>>> fourth letters are the same?
>>>       
>


  • Prev by Date: Re: How to write reports and books in Mathematica
  • Next by Date: Re: 2D plots of data points
  • Previous by thread: Re: and a type of regular expression
  • Next by thread: Re: Number of ways of permutations to form a certain pattern of