Search Results

Search found 1 results on 1 pages for 'zhon'.

Page 1/1 | 1 

  • Difference between ruby StringScanner post_match and rest?

    - by zhon
    What is the difference between ruby's StringScanner#post_match and StringScanner#rest? scanner = StringScanner.new('Say hello to...') scanner.scan(/\w+/) #=> 'Say' scanner.scan(/\s+/) #=> ' ' scanner.rest #=> 'hello to...' scanner.post_match #=> 'hello to...' scanner.rest.class #=> String scanner.post_match.class #=> String I don't see a difference. It seems like both return a string containing everything after the match.

    Read the article

1