Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Problem with matching.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53936] Re: [mg53907] Problem with matching.
  • From: yehuda ben-shimol <benshimo at bgu.ac.il>
  • Date: Fri, 4 Feb 2005 04:12:13 -0500 (EST)
  • References: <200502022310.SAA11969@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
you should write
F[{x, 2, c}]F[{x, 1, f}] /. F[{x___, a_, y___}]F[{z___, a_, w___}] :> yes
and get True
yehuda
Josef Karthauser wrote:

>Can someone tell me why this doesn't match?
>
>F[{x, 2, c}]F[{x, 1, f}] /. F[{___, a_, ___}]F[{___, a_, ___}] :> yes
>
>I'm expecting 'yes' to be returned if any of the list arguments to F[]
>contain the same value.  It doesn't match however; what am I doing
>wrong?
>
>Thanks,
>Joe
>--
>Josef Karthauser (joe at tao.org.uk)	       http://www.josef-k.net/
>FreeBSD (cvs meister, admin and hacker)     http://www.uk.FreeBSD.org/
>Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
>================ An eclectic mix of fact and theory. =================
>
>
>  
>


  • Prev by Date: Re: List Partition
  • Next by Date: Re: Problem with matching
  • Previous by thread: Problem with matching.
  • Next by thread: Re: Problem with matching.