I've decided to try to make a plugin to add support for regular expressions to DBPro, if anyone actually shows interest.
Attached is version 0.1 of the dll, here are the commands so far:
REGEX SET string - sets the regular expression being used
boolean
REGEX IS MATCH(string) - returns whether the string matches the regular expression
integer
REGEX MATCHES(string) - creates a list of all matches, and returns the number of items in the list
string
REGEX GET MATCH(integer match#) - returns an item from the list created by REGEX MATCHES (starts at 1, not 0)
string
REGEX GET GROUP(integer match#, string groupName) - returns the value of a named group
Please let me know what you think of it so far, if it doesn't work, etc.
-Jeff
[UPDATE]
I have added the ability to use named groups now, using the command:
string
REGEX GET GROUP(integer match#, string groupName)
This is useful for parsing data that is in a form such as this:
{X:5,Y:11}{X:16,Y:2}...
See the 4th section of the
sample program in the attached zip for an example of how to do this.
An updated version is attached to this post.
[/UPDATE]