[Gambas-user] Regular expressions

Markus Schatten markus.schatten at ...2005...
Fri Oct 31 17:09:21 CET 2008


On Thursday 30 October 2008 23:32:09 Rob wrote:
> On Thursday 30 October 2008 17:59, Markus Schatten wrote:
> > I'm a newbee to Gambas and I have a little problem. I would like to use
> > the pcre Regexp class, but I seem not to be able to find any examples of
> > how to instantiate a new object nor how to use such objects. Is there
> > any documentation/tutorial/example? If not could please someone post a
> > short example on how to use it?
>
> Yeah, I updated the wiki a few weeks ago with some documentation.  See if
> it's what you need and tell me if it isn't.
>
> http://gambasdoc.org/help/comp/gb.pcre
>
> Here is the page about instantiation, to which I just added a brief
> example:
>
> http://gambasdoc.org/help/comp/gb.pcre/regexp/_new
>

Thanks a lot for the links, they were very helpfull. Is there a way to use a 
regex for looping through all matches? Something like scan(....) in a for 
each loop or findall in python-re? I was able to figure out that the Text 
property holds the first match, Submatches is an array of given submatches 
(in parenthesis) and Offset holds the index if the first match. There seem to 
be no other properties defined...

Best regards,
-- 
Markus Schatten, MSc
Faculty of Organization and Informatics
Varaždin, Croatia
http://www.foi.hr




More information about the User mailing list