Regex to extract 2 first character from different patterns

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=-)[A-Z]{2}|^[A-Z]{2}",System.Text.RegularExpressions.RegexOptions.RightToLeft).Value

Regards,

2 Likes