String split after a pattern

Hi all, I have a structured string in a single line. I have to split the string after date is found

Example

FIDEL A ZELAYA CA A1234567 01/01/1986 ALEX SOTO CA 04454033 06/08/2000 JOSE M SOTO CHAVEZ CA EXCLUDED002 01/01/1979 FIDEL A ZELAYA CA EXCLUDED05 01/01/1986 MARIA C VELASCO SERNA FD 1 10/11/1966 VICTORIANO SOTO CHAVEZ FD 2 01/05/1966

Output

FIDEL A ZELAYA CA A1234567 01/01/1986
ALEX SOTO CA 04454033 06/08/2000
JOSE M SOTO CHAVEZ CA EXCLUDED002 01/01/1979
FIDEL A ZELAYA CA EXCLUDED05 01/01/1986
MARIA C VELASCO SERNA FD 1 10/11/1966
VICTORIANO SOTO CHAVEZ FD 2 01/05/1966

Thank you

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Matches(yourString,".*?\d{2}/\d{2}/\d{4}\b").Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) m.Value).ToArray()

Sample20230125-8L.zip (2.4 KB)

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.