• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 727
  • Last Modified:

vb code regex

I hhave a page loading and using a Session (string) variable

In VB code, how do I check that string for Alphanumeric only?
0
lrbrister
Asked:
lrbrister
1 Solution
 
käµfm³d 👽Commented:
You can do:

If System.Text.RegularExpressions.Regex.IsMatch(input, "^[a-zA-Z\d]+$") Then
    ' string is alphanumeric
End If

Open in new window

0
 
lrbristerAuthor Commented:
perfect!  Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now