for separate scenarios
here you go two expressions
βfor one with - in the string str_input.ToString.Contains(β-β), String.Join(β-β,Split(strinput.ToString,β-β).Take(2).AsEnumerable().select(Function(a) System.Text.RegularExpressions.Regex.Replace(a.ToString,β(\w)β,βxβ)).ToArray()).ToString+β-β+Split(strinput,β-β).Last.ToString
βfor one without - in the string System.Text.RegularExpressions.Regex.Replace(str_input.ToString,β[1]{4}β,β****β).ToString