user2169767
user2169767

Reputation: 51

vb6 Like vs vb.net regex

I need to convert one vb6.0 project into vb.Net project. I am not much familiar with .Net regular expressions. What will be the regular expression in vb.net that will be equivalent to vb Like "*_?#"

Upvotes: 0

Views: 374

Answers (1)

Juffy
Juffy

Reputation: 1220

VB6 'Like' syntax:

* = zero or more characters
_ = _ character
? = any single character
# = any digit (0-9)

.NET Regex equivalent:

.* = zero or more characters 
_ = _ character
. = any single character
\d = any single digit

So your regex string is '.*_.\d'

Edit: replaced [0-9] with \d

Upvotes: 1

Related Questions