I am new to programming.
I am creating a windows form application in Visual Studio 2013
I am trying to create a textbox into which the user enters there postcode.
I need it to accept all possible UK postcode formats, using upper and/or lower case letters as well as with/without space
So far I have the following code
namespace Moondog_odering_system
{
public partial class CustomerDetails : Form
{
public CustomerDetails()
{
InitializeComponent();
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
"(([gG][iI][rR] {0,}0[aA]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y]))) {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}))";
}
}
}
This is coming up with the following Error which I cannot work out a solution for
Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
This is assigned to line 21 which is the text above I have put in itallics
When you mouse over this code it says it is class System.String
Can anyone please provide a solution
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…