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