General::optb
Optional pattern uses __ (BlankSequence) rather than _ (Blank):
{{1}, {2}, {}} /. {Optional[__, 0]} :> pThis shows a valid Optional pattern:
{{1}, {2}, {}} /. {Optional[p_, 0]} :> pThis pattern can also be entered using shorter notation:
{{1}, {2}, {}} /. {p_ : 0} :> p