Need last value after - how to split

Hello,

i have files names like below format

Json-DC0045-97-1597584.json
Json-DC0045-370-4189600.json

i need DC0045-97 and DC0045-370 as saperate and 1597584 and 4189600 this as saperate.
how can i achieve this i have large data fro same.
help me on same.

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Match(System.IO.Path.GetFileNameWithoutExtension(yourFileName),"\d+$").Value

System.Text.RegularExpressions.Regex.Match(System.IO.Path.GetFileNameWithoutExtension(yourFileName),"(?<=\w+-)\w+-\w+").Value

Regards,

1 Like

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