in reply to Impossible RegEx?

I don't understand why you'd need a regex ?
Do you want to replace ' with \' ?

PHP has something called addslashes that will escape characters for you.

-Paul