REGEX-Escape for: sdfdfd?

Your Input:
Result, the escaped string:
sdfdfd\?

What must the escaping look like for:
sdfdfd?

The excaped text for use in a regex is:
sdfdfd\?