Validate text using RegEx

0.00 avg. rating (0% score) - 0 votes

‘Email address:
Regex.IsMatch(
Me.txtEmail.Text, “w+([-+.’]w+)*@w+([-.]w+)*.w+([-.]w+)*”)

‘Alpha-numeric (no space):
Regex.IsMatch(
Me.txtUsername.Text, “^[0-9a-zA-Z]+$”)

‘Alpha-numeric with space, at least 5 chars:
Regex.IsMatch(
Me.txtUsername.Text, “[0-9a-zA-Z’ ‘]{5,} )

0.00 avg. rating (0% score) - 0 votes
ToughDev

ToughDev

A tough developer who likes to work on just about anything, from software development to electronics, and share his knowledge with the rest of the world.

Leave a Reply