Skip to main content
Post Closed as "Duplicate" by Mr.Wizard pattern-matching
Post Reopened by Mr.Wizard
Post Closed as "Not suitable for this site" by LLlAMnYP, garej, m_goldberg, glS, xzczd
added 14 characters in body; edited title
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

Using Cases[]Cases for lists with 'containing Rule ( ->'> )

I am trying to extract an expression of given pattern from the list of the form

list={a->b,c->d} (typical output of Solve[])

list = {a -> b, c -> d} (* typical output of Solve *)

For example, all the expressions which look like x ->0> 0.

For obvious reasons, Cases[list, _ ->0]> 0] does not work. What should I do instead?

Using Cases[] for lists with '->'

I am trying to extract an expression of given pattern from the list of the form

list={a->b,c->d} (typical output of Solve[])

For example, all the expressions which look like x->0.

For obvious reasons, Cases[list,_->0] does not work. What should I do instead?

Using Cases for lists containing Rule ( -> )

I am trying to extract an expression of given pattern from the list of the form

list = {a -> b, c -> d} (* typical output of Solve *)

For example, all the expressions which look like x -> 0.

For obvious reasons, Cases[list, _ -> 0] does not work. What should I do instead?

Source Link
mavzolej
  • 693
  • 4
  • 11

Using Cases[] for lists with '->'

I am trying to extract an expression of given pattern from the list of the form

list={a->b,c->d} (typical output of Solve[])

For example, all the expressions which look like x->0.

For obvious reasons, Cases[list,_->0] does not work. What should I do instead?