Actually, I suspect that if indeed Unicode strings start at odd file (or buffer) positions, grandfathers method will fail to find them.
Interesting thought. However I checked it out with the sample code by inserting an extra byte before the 'Author' string and the match string was still found.
On reflection Perl doesn't know anything special about either the match string or the buffer being matched so the fact that there is meta information (the fact that it is actually utf-16) associated with the data is of no consequence.
In reply to Re^2: regular expression searching in binary files
by GrandFather
in thread regular expression searching in binary files
by dhlocker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |