I would like to be extend the below solution to be able to find get all rules from the list step[2]
that match the generic pattern k_Digit_p. Where k and p are not generic characters but form part of the symbol name. Unfortunately I've stalled in my understanding of symbolic pattern matches, without converting the symbol names to strings. How can I define the generic pattern above without converting to strings and performing StringMatchQ[]
test?
params={k1p,k1m,k2p,k2m,nfb,pfb};
step[1]={1.,1.,1.,1.,1.,1.};
parameterLimits={k1p->{0.25,1.5}};
step[2]=step[1][[#]]+RandomReal[{-1.,1.}]&/@Range[Length@params];
step[2]=Thread[params->step[2]]
k1p->0.0432604,k1m->0.898291,k2p->0.436556,k2m->0.917969,nfb->0.519343,pfb->1.00006}
Cases[step[2], PatternSequence[k1p -> _]]
{k1p->0.0432604}