Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The rep method matches zero or more repetitions. Table 19–1 shows several variations of this combinator. The most commonly used among them is repsep. For example, a list of comma-separated numbers can be defined as
def numberList = number ~ rep("," ~> number)