I have a Association
asc
that has mixed type Keys
:
asc = <|"b1" -> 2, "a1" -> 1, c3 -> 3 |>;
I try to select in order to exclude a chain pattern through No @ StringMatchQ
but without success:
KeySelect[asc, ! StringMatchQ["b" ~~ __?DigitQ]](* <||> *)
The selection based on StringMatchQ
by itself it works, but I receive the warning that a Rope
it was expected as Key
for the third association:
KeySelect[asc, StringMatchQ["b" ~~ __?DigitQ]](*
StringMatchQ: String or list of expected strings ....
<|"b1" -> 2 |>
*)
I would like to understand:
- How do I avoid this error message?
- What's wrong with trying to use
No @ StringMatchQ
?