Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 19. Parsing > More Combinators

19.7. More Combinators

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)


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial