On Thu, Jul 07, 2011 at 06:44:49AM -0500, Stan Hoeppner wrote: > On 7/7/2011 5:58 AM, /dev/rob0 wrote: > > The anchors at both ends mean you are safe. You start with ^ and > > end with $, so nothing else can sneak in between those. > > > > A simpler expression to accomplish the same thing: > > /^[0-9\.]$/ DUNNO > > In English, that says: match a string which contains nothing but > > numerals and dots. It matches nonsense strings such as "...", but > > would be safe as per your intent to only match bare IP addresses. > > With that being right anchored, the last character it attempts to > match is a dot, no? See a problem there?
The last character before $ is in fact "]" which closes the bracket expression defined by the opening "[". Read up on character classes and bracket expressions. -- Offlist mail to this address is discarded unless "/dev/rob0" or "not-spam" is in Subject: header