Here I have created sample that full-fill your requirement.
HTML
<form id="form1" runat="server">
<div>
Enter Code :
<asp:TextBox ID="txtCodes" runat="server" />
<br />
<br />
<asp:Button Text="Get Seperated Code" runat="server" OnClick="GetCodes" />
<br />
<br />
</div>
</form>
Code
protected void GetCodes(object sender, EventArgs e)
{
string value = this.txtCodes.Text.Trim();
HtmlTable table = new HtmlTable();
foreach (string code in GetSeperatedCode(value))
{
HtmlTableRow row = new HtmlTableRow();
HtmlTableCell cell = new HtmlTableCell();
cell.InnerHtml = code;
row.Cells.Add(cell);
table.Rows.Add(row);
}
this.form1.Controls.Add(table);
}
private List<string> GetSeperatedCode(string value)
{
List<string> values = new List<string>();
for (int i = 0; i < value.Length - 1; i++)
{
string regex = "^[a-zA-Z]{1}[0-9]{1}$";
if (Regex.IsMatch(value.Substring(i, 2), regex))
{
string abc = value.Substring(i + 1);
values.Add(value.Substring(0, i + 1));
value = abc;
i = 0;
}
}
values.Add(value);
return values;
}
Here you can see ,I have given sceenshot for both strings
Screenshot
1)
2)