clarify the slicing example (#36842) (#36847)

As stated by fellow contributors, update the slicing example

Resolves:
Related: #36625
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
(cherry picked from commit 8362ddd107)
This commit is contained in:
John R Barker 2018-02-28 13:31:33 +00:00 committed by GitHub
parent d4252c89e9
commit f14e0e7ee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,9 +81,10 @@ You can refer to hosts within the group by adding a subscript to the group name:
webservers[0] # == cobweb
webservers[-1] # == weber
webservers[0:1] # == webservers[0],webservers[1]
webservers[0:2] # == webservers[0],webservers[1]
# == cobweb,webbing
webservers[1:] # == webbing,weber
webservers[:3] # == cobweb,webbing,weber
Most people don't specify patterns as regular expressions, but you can. Just start the pattern with a '~'::