AllMatch
✖
AllMatch
Details

Examples
open allclose allBasic Examples (4)Summary of the most common use cases
Check if all elements of a list match a pattern:

https://wolfram.com/xid/0j44sc5y-hloes3


https://wolfram.com/xid/0j44sc5y-yk02xe

Check if all elements of a matrix match a pattern:

https://wolfram.com/xid/0j44sc5y-72splg


https://wolfram.com/xid/0j44sc5y-hp7jlh

Use the operator form of AllMatch:

https://wolfram.com/xid/0j44sc5y-tul23i

Check if all values of an association match a pattern:

https://wolfram.com/xid/0j44sc5y-tc0rpv

Scope (4)Survey of the scope of standard use cases
AllMatch may be applied to expressions with any head:

https://wolfram.com/xid/0j44sc5y-satqk5

AllMatch can operate on ragged expressions:

https://wolfram.com/xid/0j44sc5y-nrxatk


https://wolfram.com/xid/0j44sc5y-ddim4r

By default, AllMatch operates at level 1:

https://wolfram.com/xid/0j44sc5y-5ywwwt


https://wolfram.com/xid/0j44sc5y-q7tlwz


https://wolfram.com/xid/0j44sc5y-u8d8qa

Use Verbatim to test for a literal blank:

https://wolfram.com/xid/0j44sc5y-h6rxbu

Properties & Relations (6)Properties of the function, and connections to other functions
AllMatch[list,form] is equivalent to NoneMatch[list,Except[form]]:

https://wolfram.com/xid/0j44sc5y-tbjgd

AllMatch[list,form] works efficiently on sparse vectors:

https://wolfram.com/xid/0j44sc5y-x83x7f

AllMatch[list,form] checks the parts of list in order, stopping as soon as form does not match:

https://wolfram.com/xid/0j44sc5y-5rcria



AllMatch[list,form] is equivalent to AllTrue[list,MatchQ[form]]:

https://wolfram.com/xid/0j44sc5y-emx8zk

AllMatch[{e1,e2,…},form] is equivalent to And[MatchQ[e1,form],MatchQ[e2,form],…]:

https://wolfram.com/xid/0j44sc5y-y3s4u0

AllMatch[list,e1e2…] is equivalent to ContainsOnly[list,{e1,e2,…}]:

https://wolfram.com/xid/0j44sc5y-8ker9e

Possible Issues (1)Common pitfalls and unexpected behavior
For associations, AllMatch tests only values:

https://wolfram.com/xid/0j44sc5y-zo8sjm


https://wolfram.com/xid/0j44sc5y-8iz31t

Wolfram Research (2024), AllMatch, Wolfram Language function, https://reference.wolfram.com/language/ref/AllMatch.html.
Text
Wolfram Research (2024), AllMatch, Wolfram Language function, https://reference.wolfram.com/language/ref/AllMatch.html.
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.
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
Wolfram Language. (2024). AllMatch. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AllMatch.html
BibTeX
@misc{reference.wolfram_2025_allmatch, author="Wolfram Research", title="{AllMatch}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/AllMatch.html}", note=[Accessed: 17-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_allmatch, organization={Wolfram Research}, title={AllMatch}, year={2024}, url={https://reference.wolfram.com/language/ref/AllMatch.html}, note=[Accessed: 17-May-2025
]}