add slice patterns to the guide

Fixes #19177.