Re: Find Elements Containing "r"
- To: mathgroup at smc.vnet.net
- Subject: [mg42536] Re: [mg42520] Find Elements Containing "r"
- From: Selwyn Hollis <selwynh at earthlink.net>
- Date: Sat, 12 Jul 2003 20:53:17 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Something like this? words = {ar1, ar2, ab1, ab2, rab, ab3}; StringJoin/@ Cases[#,{___,"r",___}]&@ (Characters/@ToString/@words) ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis On Saturday, July 12, 2003, at 05:19 AM, Allan de Frates wrote: > How do I find all the elements of a list that contain the letter "r" > or some > other text pattern? For example, if the list is {ar1, ar2, ab1, ab2, > rab, > ab3} and I wanted element matching "r", the result would be {ar1, ar2, > rab}. > There has to be a simple way to do this, but I'm stumped. > > Allan de Frates > > > >