MathGroup Archive 2005

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

Search the Archive

Re: Problem with matching.

you should write
F[{x, 2, c}]F[{x, 1, f}] /. F[{x___, a_, y___}]F[{z___, a_, w___}] :> yes
and get True
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
>Josef Karthauser (joe at
>FreeBSD (cvs meister, admin and hacker)
>Physics Particle Theory (student)
>================ 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.