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: Checking for a given phrase in an expression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60761] Re: [mg60744] Checking for a given phrase in an expression
  • From: <bsyehuda at gmail.com>
  • Date: Wed, 28 Sep 2005 01:40:57 -0400 (EDT)
  • References: <200509270745.DAA18926@smc.vnet.net>
  • Reply-to: bsyehuda at gmail.com
  • Sender: owner-wri-mathgroup at wolfram.com

Out of the sleeve solution (I do not have time to have an intelligent one
right now) is to generate subsets of aa and then test if bb is a an element
in the list of subsets so
MemberQ[Subsets[aa, Length[bb]], bb]
returns True as expected
yehuda


On 9/27/05, lost.and.lonely.physicist at gmail.com <
lost.and.lonely.physicist at gmail.com> wrote:
>
> Hello everyone
>
> Is it possible to ask Mathematica to check if a given phrase occurs in
> an expression? Say I have
>
> aa = 1 + x + x y + Log[Sin[z]]
>
> and
>
> bb = x + Log[Sin[z]]
>
> Can Mathematica tell me such a phrase bb exists in aa? Can it tell me
> its 'position' within the expression aa?
>
> Thanks for the help!
>
>



  • Prev by Date: Re: Problem running multiple lines in a cell
  • Next by Date: Re: SingularValueDecomposition bug: fifty examples
  • Previous by thread: Checking for a given phrase in an expression
  • Next by thread: Re: Re: Checking for a given phrase in an expression