my string is "The operating system is Win32"
This is what i do in perl
if $string =~ /Thes operating system is Win32|Linux|Unix/ {
}
which mean the OS can be unix Linux or Win32
How this can be achieved in VBA
Dim oRE As Object 'VBScript_RegExp_55.RegExp
Set oRE = CreateObject("VBScript.RegExp")
oRE.Pattern = "The operating system is Win32|Linux|Unix"
If oRE.Test("The operating system is Win32") Then
'Match found
End If
For some links to documentation see
http://www.j.nurick.dial.pipex.com/Code/vbRegex/MoreAboutRegexp.htm
"perlperl" <shahr...@gmail.com> wrote in message
news:1142780786.8...@e56g2000cwe.googlegroups.com...
can I do
If oRE.Test("The operating system is Win32|Linux|Unix") Then
"The operating system is X"
where X can be "Win32", or "Linux", or "Unix".
If that's not what you want, please describe what you /do/ want.
HTH,
TC (MVP Access)
http://tc2.atspace.com
i tried the pattern
oRE.Pattern = "\d+.\d+.\d+.\d+"
If oRE.Test(.Text) Then ' .Text contains the IP address
It didn't worked
but if the IP is 44.4.4.4, it does not work
Do you need to enbracket the periods? [0-9]+[.][0-9]+[.] etc