Thread: regEx replace
View Single Post
  #11   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:
Hi again,

Am Thu, 2 Apr 2015 10:26:21 -0700 schrieb Robert Crandal:

regEx.Pattern = "\d\d\d-\d\d-\d\d\d\d"


try it with

ptrn = "[\d-\d-\d]"


Okay, that works good enough for me.

However, it is not very precise because it will also
erase something like 123-45-67890000000025, which
is not a valid Social Securty number.

Your solution is still good enough, because I don't
expect my data will contain odd numbers like that.