AllMatch
例題
すべて開く すべて閉じる例 (4)
リストの全要素がパターンにマッチするかどうかをチェックする:
AllMatch[{x ^ 2, x ^ 3, x ^ 5, x ^ 6}, x ^ _]AllMatch[{x ^ 2, y ^ 3, x ^ 5, x ^ 6}, x ^ _]AllMatch[{{1, 2, 3}, {4, 5, 6}}, _Integer, 2]AllMatch[{{a, 2, c}, {4, e, 6}}, _Integer, 2]AllMatchの演算子形を使う:
AllMatch[_Integer][{1, 2, 3, 4, 5}]連想のすべての値がパターンにマッチするかどうかをチェックする:
AllMatch[<|"a" -> 1, "b" -> 2, "c" -> 3|>, _Integer]スコープ (4)
AllMatchは,任意の頭部を持つ式に適用できる:
AllMatch[f[1, 2, 3], _Integer]AllMatchは,不揃いの式にも動作する:
AllMatch[{{1, 2, 3}, {4, 5}}, _Integer, 2]AllMatch[f[{1, 2, 3}, {4, 5}], _Integer, 2]デフォルトで,AllMatchはレベル1に作用する:
AllMatch[4, _String]AllMatch[{}, _String]AllMatch[4, _String, 0]Verbatimを使ってリテラルなブランクを検証する:
AllMatch[f[_, _, _], Verbatim[_]]特性と関係 (6)
AllMatch[list,form]はNoneMatch[list,Except[form]]に等しい:
{AllMatch[{1, 2, 3, 4, 5}, _Integer], NoneMatch[{1, 2, 3, 4, 5}, Except[_Integer]]}AllMatch[list,form]は疎なベクトルに効果的に作用する:
AllMatch[SparseArray[{1000 -> 2}, {1000000000000}], _Integer]AllMatch[list,form]は list の各部分を順にチェックし,form がマッチしなくなると停止する:
AllMatch[{1, 2, 3, 4, 5}, _ ? (OddQ @* Echo)]AllMatch[list,form]はAllTrue[list,MatchQ[form]]に等しい:
{AllMatch[{1, 2, 3, 4, 5}, _Integer], AllTrue[{1, 2, 3, 4, 5}, MatchQ[_Integer]]}AllMatch[{e1,e2,…},form]はAnd[MatchQ[e1,form],MatchQ[e2,form],…]に等しい:
{AllMatch[{1, 2, 3}, _Integer], MatchQ[1, _Integer] && MatchQ[2, _Integer] && MatchQ[3, _Integer]}AllMatch[list,e1|e2|…]はContainsOnly[list,{e1,e2,…}]に等しい:
{AllMatch[{a, a, b, a, b}, a | b], ContainsOnly[{a, a, b, a, b}, {a, b}]}考えられる問題 (1)
連想については,AllMatchは値だけを検証する:
AllMatch[<|a -> 1|>, 1]AllMatch[<|a -> 1|>, a]関連するガイド
-
▪
- パターンマッチング関数 ▪
- リスト操作 ▪
- リストの要素 ▪
- 判定式 ▪
- 関数の合成と演算子形式 ▪
- 集合の操作
テキスト
Wolfram Research (2024), AllMatch, Wolfram言語関数, 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
BibTeX
@misc{reference.wolfram_2026_allmatch, author="Wolfram Research", title="{AllMatch}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/AllMatch.html}", note=[Accessed: 17-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_allmatch, organization={Wolfram Research}, title={AllMatch}, year={2024}, url={https://reference.wolfram.com/language/ref/AllMatch.html}, note=[Accessed: 17-August-2026]}