SQL Like escaping helper method. [Rob Gilson & Yves Senn]

Closes #14222.

This is a follow up to #6104

This does not have the backwards compatibility issues brought up in
implementation to break.