in reply to regular expression to retrieve text within single quotes

It's not a regexp, but $str = substr($str, 1, -1) does the trick efficiently, assuming the quotes are guaranteed to be there.