NET Regular Exp patterns work in VB6?

T

Thiru.net

Hi, Will .NET Regular Exp patterns work in VB6? ex: reg exp pattern
for email in .net \w+([-+.']\w+)*@\w+([-.]\w+)*\­.\w+([-.]\w+)* Will
this work if i use it in vb6? Anybody has idea about it. Please
comment on this. Thanks, Thiru.S
 
J

Jesse Houwing

Hello Peter Ritchie [C# MVP],
Not without work.

You could use JScript regular expressions:
http://www.regular-expressions.info/vb.html

Otherwise, you would to wrap the Regex class from .NET in a COM object
that could be used from VB6.

There are a lot of Regular Expressions that should 'just work' especially
if you set the ECMAScript option on the .NET regex object. That way it uses
the same syntax as used by Javascript/JScript/VBScript, so that way chances
of problems are pretty slim.

If you do not specify that option, then the .NET variant is a lot more powerful,
though these advanced features aren't used that often. Mostly people have
a hard enough time understanding normal regex to begin with.


Jesse
Hi, Will .NET Regular Exp patterns work in VB6? ex: reg exp pattern
for email in .net \w+([-+.']\w+)*@\w+([-.]\w+)*\­.\w+([-.]\w+)* Will
this work if i use it in vb6? Anybody has idea about it. Please
comment on this. Thanks, Thiru.S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top