[Gambas-devel] pcre component 0.0.3 - working
Brought to you by:
gambas
From: Rob <sou...@ku...> - 2004-09-30 20:45:20
|
Here is gb.pcre 0.0.3. It seems to work fully now, though I would appreciate suggestions on more methods/properties. The class is called Regex. You initialize it like this: dim re as Regex re = new Regex("string to match", "regular expression") It has these members: integer property Offset - offset of the match if successful. string property Match - that part of the string that matched the whole expression. integer property SubMatchCount - number of submatches available. string method SubMatch - takes index of the desired submatch and returns the matching substring. A submatch is part of a match you put in parenthesis, like this: re = new Regex("quick brown fox", "(b.+?)\s(\S+)") Submatch 1 is "brown", submatch 2 is "fox". It's still available from http://www.kudla.org/rpm/ but here is the tarball. also included is an example gambas project. That error dialog I was getting earlier went away... I don't know why, but I did reinstall gambas between then and now. Rob |