JLospinoso / ccc

Companion Code for C++ Crash Course
https://ccc.codes
GNU General Public License v3.0
377 stars 105 forks source link

Page 507, chapter 15, Section "Algorithms Matching", Tale 15-11: Supported Operations of match_results #190

Closed g8151 closed 2 years ago

g8151 commented 3 years ago

mr.position([i]) description says : "Returns the character of the first position of sub-match i, which defaults to 0"

The reference says "Returns the position of the first character of the specified match or sub-match." which is less ambiguous and the opposite of the definition above.

Reference: https://en.cppreference.com/w/cpp/regex/match_results/position

mr.format(str) description says "Returns a string with contents according to the format string str. There are three special sequences: $' for the character before a match (the book uses the 'single quote' character after the dollar sign. The correct character is the 'backtick' character)"

NOTE: The second correction joins issue #111 , raised by @WraithGlade

Suggestion: Perhaps, it would also help avoid confusion by specifying the symbols being used in natural language (English in this case)

JLospinoso commented 2 years ago

Thank you!