Show us the actual code that you used when you "tried to capture whitespaces". Also tell us what "its not working" really means: what did it do, and how did that differ from what you wanted to do. These details will help us help you.
Re^3: How to remove white space and more than a particular number of new lines!
Replies are listed 'Best First'.