Hi!
On Unix regular expressions work with brackets.
So, when I have a regexp "X([0-9]*)V([0-9]*)Z"
the string "X15V27Z" gives me two matches, one for
each number.
Is there any way to get this in VBScript regular
expressions too?

Lots of Greetings!
Volker

Re: Regexp Matching... by Marty

Marty
Fri Nov 04 06:58:47 CST 2005


"Volker Hetzer" <volker.hetzer@ieee.org> wrote in message
news:dkfla0$cgm$1@nntp.fujitsu-siemens.com...
> Hi!
> On Unix regular expressions work with brackets.
> So, when I have a regexp "X([0-9]*)V([0-9]*)Z"
> the string "X15V27Z" gives me two matches, one for
> each number.
> Is there any way to get this in VBScript regular
> expressions too?
>
> Lots of Greetings!
> Volker


That should work, but it's hard to say without seeing the code that's
calling it, or knowing what results you are getting.

Here's the documentation:
http://msdn.microsoft.com/library/en-us/script56/html/vsproPattern.asp




Re: Regexp Matching... by Volker

Volker
Fri Nov 04 07:29:09 CST 2005

Marty List wrote:
> "Volker Hetzer" <volker.hetzer@ieee.org> wrote in message
> news:dkfla0$cgm$1@nntp.fujitsu-siemens.com...
>
>>Hi!
>>On Unix regular expressions work with brackets.
>>So, when I have a regexp "X([0-9]*)V([0-9]*)Z"
>>the string "X15V27Z" gives me two matches, one for
>>each number.
>>Is there any way to get this in VBScript regular
>>expressions too?
>>
>>Lots of Greetings!
>>Volker
>
>
>
> That should work, but it's hard to say without seeing the code that's
> calling it, or knowing what results you are getting.
>
> Here's the documentation:
> http://msdn.microsoft.com/library/en-us/script56/html/vsproPattern.asp
>
>
>
Found it now. It's a bit hidden but there's a SubMatches property in the
Match object. That contains the strings of the sub matches.

Lots of Greetings and thanks!
Volker