vbscript.regexp

This forum is for general support of Xbase++
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

vbscript.regexp

#1 Post by Cliff Wiernik »

I am looking at some simple regular expressions process where I will split out a normal US address line into its components. Number, Predirectional, street, type of street, post directional, apartment. I have some simple code using vbscript.regexp and while I can get the execute option to work, it creates a match and match collection as the output and I do not know yet how to work with that. I see Phil Ide's regexp item using PCRE.DLL but have not looked at that yet.

I am not interested in some of the services available at this time. That if for the future. I need to reasonably extract the street for some duplicate address checking we do.

The code in vb is as follows. I am trying to determine how to use the match collection and match items from vb in Xbase++. Plus with Xbase++ objects you can inspect them to look at the instances variables and methods. How do you do this with an activeX/com object.

Code: Select all

        Set mc = re.Execute(strInput)                                              // executes the vbscript.regexp execute  method
                                                                                              // mc appears to be a match collection returned by the exceute
        Set ma = mc(0)                                                                 // ma is a match  
         
        uxHouseNumber = Trim$(ma.SubMatches(0))
        uxStreetPrefix = Trim$(ma.SubMatches(1))
        uxStreetName = Trim$(ma.SubMatches(2))
        uxStreetType = Trim$(ma.SubMatches(3))
        uxStreetSuffix = Trim$(ma.SubMatches(4))
        uxApt = Trim$(ma.SubMatches(5))


User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: vbscript.regexp

#2 Post by rdonnay »

Plus with Xbase++ objects you can inspect them to look at the instances variables and methods. How do you do this with an activeX/com object.
For years, I have asked Alaska Software to give us a ClassDescribe() for automation objects but they have given it no priority.

I had to write a kludgy workaround for CodeJock in which I built a bunch of .DEF files (located in \exp20\classdef).

DC_InspectObject() will look for a .DEF file when inspecting an automation (ActiveX) object.

I created some utilities that scans a .PRG file created by JazzAge Wizard to do this.
It was a real pain in the ass.

I need some pressure from our community to Alaska to get some help from them on this.
It is way overdue.
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: vbscript.regexp

#3 Post by Cliff Wiernik »

I also looked at the jazzage info. I will ask some questions of Alaska support also. But as you indicated, if you don't know what is coming back, it is hard to work with.

Post Reply