I need to store or use a matched pattern, as I need it later on. I'd like it so that the match is NOT confined in a pattern-like syntax like:
pattern /; test
lhs :> rhs /; test
lhs := rhs /; test
or
pattern ? test
So I've been using this:
MatchQ[expr, x:pattern /; (var = x; True)]
Is there a neater way to do it, like:
var = MatchQ[expr, x:pattern extracode]
var==x
. Could you provide a simple example of some inputs and the desired outputs? $\endgroup$Cases
perhaps do what you have in mind? $\endgroup$