[1.7.x] Fixed #23578 -- Changed examples in docs to use patterns

Good catch, sorry about that. I've updated the patch and pushed it again.