develooper Front page | perl.perl5.porters | Postings from June 2010

Re: What should /\08/ match and do?

Thread Previous | Thread Next
From:
David Cantrell
Date:
June 1, 2010 03:22
Subject:
Re: What should /\08/ match and do?
Message ID:
20100601102243.GA16856@bytemark.barnyard.co.uk
On Fri, May 28, 2010 at 10:16:59AM -0600, karl williamson wrote:

> I thought I would just silence the message; but it occurs to me that it 
> would be very unlikely for someone to want to match a NUL followed by 
> anything else; or is that my C-centric thinking?

Anyone using regexes to pick apart a binary file format might use that.

eg my Palm::Treo680MessagesDB

but in that I consistently use \00 for a NUL, never \0.

Seems to me that \08 should scream and shout, because if it's meant to
match NUL followed by 8, then you should expect Pain if the programmer
ever has to change it to match NUL followed by 7, or NUL followed by 40,
or ...

-- 
David Cantrell | http://www.cantrell.org.uk/david

Never attribute to malice that which can be explained by stupidity
    -- Hanlon's Razor

Stupidity maintained long enough is a form of malice
    -- Richard Bos's corollary

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About