Ad
  • Default User Avatar

    It's regex combined with a "replacement routine" offered by the C++ std lib . Have a look at https://en.wikipedia.org/wiki/Regular_expression. In short, it looks for anything which looks like (alphanumeric character)(maybe some more alphanumeric characters)(whitespace or end), and replaces the captured parts (in parentheses) as (maybe some more alphanumeric characters)(alphanumeric character)ay(whitespace or end). Imho, the last capture group should actually also include punctuation to work correctly.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution