From d9086ab46bb5cc60f3c80d684d9b34397bbd7d21 Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Fri, 14 Aug 2015 07:14:42 +0530 Subject: [PATCH] Describe the groupname[x]/[x:y] syntax in more detail --- docsite/rst/intro_patterns.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docsite/rst/intro_patterns.rst b/docsite/rst/intro_patterns.rst index 07160b2182..8315c09b51 100644 --- a/docsite/rst/intro_patterns.rst +++ b/docsite/rst/intro_patterns.rst @@ -68,13 +68,19 @@ It's also ok to mix wildcard patterns and groups at the same time:: one*.com:dbservers -As an advanced usage, you can also select the numbered server in a group:: - - webservers[0] +You can select a host or subset of hosts from a group by their position. For example, given the following group:: -Or a range of servers in a group:: + [webservers] + cobweb + webbing + weber - webservers[0:25] +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] + # == cobweb:webbing Most people don't specify patterns as regular expressions, but you can. Just start the pattern with a '~'::