remove one of your string.Join
var rangelessSecondaryUnitPattern =
@"(?<SECONDARYUNIT>" +
string.Join("|", rangelessSecondaryUnits.Keys.ToArray()) +
@")\b";
Your error, besides the ToArray
is that in .NET3.5 there's no overload that takes a params string[]
. But, your outer string.join
was doing nothing, because your inner string.Join
was returning the one string.