In addition to this I was wondering if it would be possible to replace all occurrances of 4 spaces with ["t"]. The reason is that text editors will convert all tabs to spaces. It would be unusual to have 4 spaces in normal text, so that shouldn't be a problem. 4 spaces is the most common tab depth. See this posting for an example:
http://p2p.wrox.com/topic.asp?TOPIC_ID=1021
regards
David Cameron