punchcard_don has asked for the wisdom of the Perl Monks concerning the following question:
Related to another thread, I need to do simple pattern matching and replacing on a file in binary mode (because its a binary file!).
I'm looking for, for example, '77777'(decimal), which is '37 37 37 37 37'(hex), or '0010 0101 0010 0101 0010 0101 0010 0101 0010 0101' (binary).
How does one construct a simple pattern matching and replacing regex in binmode?
Another wrinkle - in binary files, is there sucha thing as 'lines' requiring that we worry about matching over two lines?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern matching in binary mode
by Abigail-II (Bishop) on Mar 19, 2004 at 13:07 UTC | |
|
Re: Pattern matching in binary mode (I/O)
by tye (Sage) on Mar 19, 2004 at 17:15 UTC | |
by kschwab (Vicar) on Oct 20, 2021 at 21:34 UTC | |
|
Re: Pattern matching in binary mode
by tachyon (Chancellor) on Mar 19, 2004 at 13:42 UTC | |
|
Re: Pattern matching in binary mode
by matija (Priest) on Mar 19, 2004 at 13:16 UTC | |
|
Re: Pattern matching in binary mode
by Hofmator (Curate) on Mar 19, 2004 at 12:58 UTC |