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: Pattern matching in functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54403] Re: [mg54379] Pattern matching in functions
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 20 Feb 2005 00:08:03 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Cases[l^4*a[b][l]+l*a[c][l],
  a[y_][_]->y,{0,Infinity}]

{b,c}


Bob Hanlon

> 
> From: Maximilian Ulbrich <mulbrich at berkeley.edu>
To: mathgroup at smc.vnet.net
> Date: 2005/02/19 Sat AM 02:32:49 EST
> To: mathgroup at smc.vnet.net
> Subject: [mg54403] [mg54379]  Pattern matching in functions
> 
> Hi,
> 
> I would like to find subexpressions using Cases.
> In the following case, I expected to find a[b] and a[c] and therefore
> get {b,c} as the result. However, I get {l,l}.
> What happens and how can I solve this?
> 
> Cases[l^4*a[b][l] + l*a[c][l], x_a[y_] -> y, {0, Infinity}]
> 
> Thanks,
> Max
> 
> 


  • Prev by Date: Re: Pattern matching in functions
  • Next by Date: Re: Question about an integral
  • Previous by thread: Re: Pattern matching in functions
  • Next by thread: Re: Pattern matching in functions