> -----Original Message----- > From: Miretsky, Anya [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 15, 2001 11:57 AM > To: 'Bob Showalter' > Subject: RE: Regulare Expressions/ Substitution Question > > > I don't understand why but if I write the substitution the > way you have it, > the word St. gets replaced with St.. when the comparison > string is St ? This > is what I was trying to fix.
No, you're right. I have my head firmly inserted in my rear! The dot is not a word character, so the \b matches before the dot. You can add a negative look-ahead to handle that: s/\bst\b(?!\.)/St./gi; This matches st ending on a word boundary, NOT followed by a period. Sorry for all the confusion. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]