Thread: regEx replace
View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_3_] Robert Crandal[_3_] is offline
external usenet poster
 
Posts: 161
Default regEx replace

"Claus Busch" wrote:

str = "Call me at (123)456-7890"

ptrn = "\(\d{3}\)\d{3}-\d{4}"


That one didn't work. The output was
"Call me at *"

Oh, the pattern for the SSN didn't work
either: ptrn = "\b[0-9]{3}-[0-9]{2}-[0-9]{4}\b"
It replaces the entire SSN with a single "*" char.