Try using the regular expression functions.
Sorry but im still new to postgresql, so i cant give you a working example right now.