emblem
Programmer
- Jun 25, 2002
- 26
Hello experts,
I have a word document with lines of dates, plus other text. Most of the dates are
05/01/2006 i.e (<[0-9]{2}/[0-9]{2}/[0-9]{4}>) pattern
But some of the dates are 07/01/2004~08/01/2006, where the ~ is a literal
I even have some 06/01/2002~03/01/2006~09/01/2007 lines
I am trying to replace all of the latter two types with just the first date, to get
05/01/2006
07/01/2004
06/01/2002
But I am having trouble defining the ~ as a separator. Seems like (<~*[0-9]>) could define the extra dates (start with a ~, then anything, ending with four digits), but the Search field does not like this. If it did, I was hoping to replace the whole thing with \1
Any guidance much appreciated.
I have a word document with lines of dates, plus other text. Most of the dates are
05/01/2006 i.e (<[0-9]{2}/[0-9]{2}/[0-9]{4}>) pattern
But some of the dates are 07/01/2004~08/01/2006, where the ~ is a literal
I even have some 06/01/2002~03/01/2006~09/01/2007 lines
I am trying to replace all of the latter two types with just the first date, to get
05/01/2006
07/01/2004
06/01/2002
But I am having trouble defining the ~ as a separator. Seems like (<~*[0-9]>) could define the extra dates (start with a ~, then anything, ending with four digits), but the Search field does not like this. If it did, I was hoping to replace the whole thing with \1
Any guidance much appreciated.