Val is VB6, it's legacy, like, 100 year old legacy. CInt(TextBox1.Text) does the same thing, as does Integer.TryParse(TextBox1.Text), only it's newer, better and very likely faster. Regex stands for Regular Expressions, google it and you'll see. There are also plenty of tutorials on this forum about using Regex.