Pattern[symb, patt]
or symb : patt
symb_head
symb : _head
(accordingly with __
and ___
).
symb : patt : default
Optional[patt : symb, default]
.
FullForm[a_b]
FullForm[a:_:b]
Pattern
has attribute HoldFirst
, so it does not evaluate its name:
x = 2
x_
Nested Pattern
assign multiple names to the same pattern. Still,
the last parameter is the default value.
f[y] /. f[a:b:_:d] -> {a, b}
This is equivalent to:
f[] /. f[a:b_:d] -> {a, b}
FullForm
:
FullForm[a:b:c:d:e]