How to use regix?

Hi,

Can you try the following sample?

m =System.Text.RegularExpressions.Regex.Match(strData,"^([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)$")

Then

m.Groups(1).Value+"-"+m.Groups(2).Value+"-"+m.Groups(3).Value+"-"+m.Groups(4).Value+"-"+m.Groups(5).Value

m.Groups(6).Value+"-"+m.Groups(4).Value+"-"+m.Groups(5).Value

m.Groups(6).Value

Sample
Sample20250324-2.zip (2.7 KB)

Regards,

2 Likes