This class returns a parser that causes the input
position to advance to column number
, where column numbers are
counted starting from 1. The value matched by this
parser is the string of characters between the current
position and position
. It is an error if the
current position is past column
>>> pat = pp.Word(pp.alphas, max=4)+pp.GoToColumn(5)+pp.Word(pp.nums) >>> print pat.parseString('ab@@123') ['ab', '@@', '123'] >>> print pat.parseString('wxyz987') ['wxyz', '', '987'] >>> print pat.parseString('ab 123') ['ab', '', '123']
In this example,
pat is a parser with
three parts. The first part matches one to four letters.
The second part skips to column 5. The third part
matches one or more digits.
In the first test, the
'@@' because that was the text
between the letters and column 5. In the second test,
that parser returns the empty string because there are no
'987'. In the third example, the part matched
GoToColumn is empty because white
space is ignored between tokens.