refactored to rename function and reorder purging function used for escape sequences.
added more code to samples. added ?, !,~ to attribute escape sequences list.