Thread: regEx replace
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default regEx replace

Hi Robert,

Am Thu, 2 Apr 2015 10:39:38 -0700 schrieb Robert Crandal:

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


you can add the length of the substrings:

ptrn = "[\d{3}\d{2}\d{4}]"


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional