Yes, you seem to misunderstand the function of the characters in the first and third example. Try looking it up. (Or looking it up in another place?)
The second one indeed works, but does more than requested, which is why you get the error you get.
I'd prefer it if you don't post spoilers at all. You can always talk in private (PM or IRC) if you want to go into details.