I deal with a mixture of text and binary file. I want to search a
pattern in the string and replace it with a new pattern, then write to a
new file. I use the following script(only part of the script)
It works fine if the both old_pattern and new_pattern are the same size.
But it will produce unpreditable result if the sizes are different. I
wonder if any one out there knows how to explain it and provide a Ruby