AnyMatch
AnyMatch[expr,form,level]
tests parts of expr at level level.
Details
![](Files/AnyMatch.en/details_1.png)
Examples
open allclose allBasic Examples (4)
Check if any element of a list matches a pattern:
Check if any element of a matrix matches a pattern:
Use the operator form of AnyMatch:
Scope (4)
Properties & Relations (6)
AnyMatch[list,form] is equivalent to !NoneMatch[list,form]:
AnyMatch[list,form] works efficiently on sparse vectors:
AnyMatch[list,form] checks the parts of list in order, stopping as soon as form matches:
AnyMatch[list,form] is equivalent to AnyTrue[list,MatchQ[form]]:
AnyMatch[{e1,e2,…},form] is equivalent to Or[MatchQ[e1,form],MatchQ[e2,form],…]:
AnyMatch[list,e1e2…] is equivalent to ContainsAny[list,{e1,e2,…}]:
Possible Issues (1)
For associations, AnyMatch tests only values:
Text
Wolfram Research (2024), AnyMatch, Wolfram Language function, https://reference.wolfram.com/language/ref/AnyMatch.html.
CMS
Wolfram Language. 2024. "AnyMatch." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AnyMatch.html.
APA
Wolfram Language. (2024). AnyMatch. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AnyMatch.html