[Gambas-user] pcre component 0.0.3 - working
Nelson Ferraz
nferraz at ...184...
Fri Oct 1 15:59:35 CEST 2004
Rob wrote:
> 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")
Rob,
How difficult would it be to integrate the regexps into the language
itself? Something like (given MyStr = "quick brown fox"):
IF MyStr MATCH "fox" THEN ...
Or even:
IF MyStr LIKE "fox" THEN ...
In this case, we'd be overriding a Gambas keyword.
Benoit: it interesting to note that regexps offer a superset of what
LIKE currently offers; you can match against a string, like "fox", but
you also can match against more elaborate patterns, like "\w" (letters),
"\d" (digits), "\s" (spaces), etc.
More information about the User
mailing list