No, \bst\b won't work because . is treated as a word boundry and therefore
st. will be turned into st..

You might try s/\bst\s/st./ instead 

-----Original Message-----
From: Bob Showalter
To: 'Gibbs Tanton - tgibbs'; 'Miretsky, Anya '; ''[EMAIL PROTECTED]' '
Sent: 11/15/2001 12:05 PM
Subject: RE: Regulare Expressions/ Substitution Question

> -----Original Message-----
> From: Gibbs Tanton - tgibbs [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 15, 2001 12:08 PM
> To: 'Miretsky, Anya '; ''[EMAIL PROTECTED]' '
> Subject: RE: Regulare Expressions/ Substitution Question
> 
> 
> What you want is a negative lookahead
> 
> $iter =~ s/\b$varS(?!\.)/St./gi;
> 
> That says to find any occurrence of $varS that is preceeded by a word
> boundry (so you don't replace things like worst) and is NOT 
> followed by a .

But that will change "Street" to "St.reet", which I don't think the OP
wants.

I think the simple s/\b$varS\b/St./gi is all that's needed.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to