The simplest and fastest way to do this would be to write a tiny assembly in
VB, and use the VB Like operator, which does exactly what you want. Put one
static (Shared in VB) function into it, that takes the two strings and
returns a Boolean.
E.g.:
Public Shared Function VBLike(Byval oneString as String, byval otherString
as String) as Boolean
Return oneString Like otherString
End Function
I hope this doesn't set off a flame war, and I'm sure that there's also a
way to do it with Regex, but it's a quick way to get what you want.
Actually, I'll confess that this response is a little tongue-in-cheek, but
what can I say :-) Pretty quick someone will be along with the Regex
equivalent. If I don't see such a response after a while I'll work one up
for you in C#.
Tom Dacon
Dacon Software Consulting
"Andrus" <ko********@hot.eewrote in message
news:uE**************@TK2MSFTNGP04.phx.gbl...
>I need to implement vfp function which uses * and ? wildcards:
static bool Like( cExpression1, cExpression2)
cExpression1
Specifies the character expression that Like( ) compares with
cExpression2.
cExpression1 can contain the wildcards such as * and ?. The question mark
(?) matches any single character in cExpression2 and the asterisk (*)
matches any number of characters. You can mix any number of wildcards in
any
combination in cExpression1.
cExpression2
Specifies the character expression LIKE( ) compares with cExpression1.
returns true on wildcards match.
How to implement this ?
Andrus