code: func (s *Scanner) ScanRegex() (tok Token, pos Pos, lit string) {
  	_, pos = s.r.curr()
  
  	// Start & end sentinels.
  	start, end := '/', '/'
  	// Valid escape chars.
  	escapes := map[rune]rune{'/': '/'}
  
  	b, err := ScanDelimited(s.r, start, end, escapes, true)
  
  	if err == errBadEscape {
  		_, pos = s.r.curr()
  		return BADESCAPE, pos, lit
  	} else if err != nil {
  		return BADREGEX, pos, lit
  	}
  	return REGEX, pos, string(b)
  }
docs: // ScanRegex consumes a token to find escapes