WLJS LogoWLJS Notebook

Alternatives

p1 | p2 | ... is a pattern object that represents any of the patterns pi.

Examples

Match multiple patterns:

Cases[{1, "a", 2, "b", 3}, _Integer | _String]
(* {1, "a", 2, "b", 3} *)

Use alternatives in string patterns:

StringCases["cat dog bird", "cat" | "dog"]
(* {"cat", "dog"} *)

Please visit the official Wolfram Language Reference for more details.

On this page