Hey Bob,
From what I can see there are several issues here.........
The string that you are comparing to has '\t' as text inserted in the string not the code '\t' indicating a tab. To correct this, right click on the regular expression constant and select 'codes display'. You will then see some extra '\' inserted. Remove these (i.e. make it look like it did when it wasn't in code display mode).
The reason you are losing a character is that the text you are writing is longer than the text you are replacing. Remember that you are writing text from the start of the file regardless of how may characters were read. If you read 5 characters and wrote 10, you would replace the first 5 that you intended plus an extra 5 that you didn't want to overwrite.
The only way around this is to read the text into memory after the matched string, append this to your new text and write it all out again.You can not just say 'replace the first line of text' because this requires other data in the file to be moved anyway.
I agree with Mikkel, you have already read all of the text into memory so instead of using the match pattern icon, whjy not use the search and replace icon which will do the replace for you and then write out the whole text again. I have attached what I mean.
Hope I have understood what you are trying to do!
Cheers
Download File:post-7495-1168703637.vi