NoneMatch
Details
- NoneMatch[expr,form] and NoneMatch[expr,form,level] only test as many ei as are necessary to determine the result. »
- NoneMatch[list,form] is equivalent to NoneMatch[list,form,1].
- NoneMatch works on associations, testing values but not keys. »
- NoneMatch[form][list] is equivalent to NoneMatch[list,form].
Examples
open all close allBasic Examples (4)
Check if no element of a list satisfies a condition:
NoneMatch[{x ^ 2, x ^ 3, x ^ 5, x ^ 6}, y ^ _]NoneMatch[{x ^ 2, x ^ 3, x ^ 5, x ^ 6}, x ^ _]Check if no element of a matrix satisfies a condition:
NoneMatch[{{a, b, c}, {d, e, f}}, _Integer, 2]NoneMatch[{{a, 2, c}, {4, e, 6}}, _Integer, 2]Use the operator form of NoneMatch:
NoneMatch[_Integer][{a, b, c, d, e}]Check if all values of an association match a pattern:
NoneMatch[<|"a" -> a, "b" -> b, "c" -> c|>, _Integer]Scope (4)
NoneMatch may be applied to expressions with any head:
NoneMatch[f[a, b, c], _Integer]NoneMatch can operate on ragged expressions:
NoneMatch[{{a, b, c}, {d, e}}, _Integer, 2]NoneMatch[f[{a, b, c}, {d, e}], _Integer, 2]By default, NoneMatch operates at level 1:
NoneMatch[4, _Integer]NoneMatch[{}, _Integer]NoneMatch[4, _Integer, 0]Use Verbatim to test for a literal blank:
NoneMatch[f[_], Verbatim[_]]Properties & Relations (6)
NoneMatch[list,form] is equivalent to AllMatch[list,Except[form]]:
{NoneMatch[{1, 2, 3, 4, 5}, _String], AllMatch[{1, 2, 3, 4, 5}, Except[_String]]}NoneMatch[list,form] works efficiently on sparse vectors:
NoneMatch[SparseArray[{1000 -> 2}, {1000000000000}], _String]NoneMatch[list,form] checks the parts of list in order, stopping as soon as form matches:
NoneMatch[{1, 2, 3, 4, 5}, _ ? (EvenQ @* Echo)]NoneMatch[list,form] is equivalent to NoneTrue[list,MatchQ[form]]:
{NoneMatch[{1, 2, 3, 4, 5}, _String], NoneTrue[{1, 2, 3, 4, 5}, MatchQ[_String]]}NoneMatch[{e1,e2,…},form] is equivalent to Nor[MatchQ[e1,form],MatchQ[e2,form],…]:
{NoneMatch[{1, 2, 3}, _Srting], Nor[MatchQ[1, _String], MatchQ[2, _String], MatchQ[3, _String]]}NoneMatch[list,e1|e2,…] is equivalent to ContainsNone[list,{e1,e2,…}]:
{NoneMatch[{a, a, b, a, b}, c | d], ContainsNone[{a, a, b, a, b}, {c, d}]}Possible Issues (1)
For associations, NoneMatch tests only values:
NoneMatch[<|a -> 1|>, 1]NoneMatch[<|a -> 1|>, a]History
Text
Wolfram Research (2024), NoneMatch, Wolfram Language function, https://reference.wolfram.com/language/ref/NoneMatch.html.
CMS
Wolfram Language. 2024. "NoneMatch." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NoneMatch.html.
APA
Wolfram Language. (2024). NoneMatch. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NoneMatch.html
BibTeX
@misc{reference.wolfram_2026_nonematch, author="Wolfram Research", title="{NoneMatch}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/NoneMatch.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_nonematch, organization={Wolfram Research}, title={NoneMatch}, year={2024}, url={https://reference.wolfram.com/language/ref/NoneMatch.html}, note=[Accessed: 12-June-2026]}