• The explanation is fine for the second example.

    But there's no mention of why a NULL value for 'replace with' returns a non-null result.

    This confused me when I first came across it, and confuses me still!