[NLUUG]   Welcome to ftp.vim.org,
Hosted by ftp.nluug.nl
Current directory: /os/Linux/distr/vectorlinux/Uelsk8s/GAMBAS/gambas-svn/gambas2/gb.pcre/src/
Contents of README:
gb.pcre

Gambas PCRE Component

version 0.04 - 4 October 2004

Copyright 2004 Rob Kudla and Benoit Minisini

This component is licensed under the same terms as Gambas itself,
namely those of the GNU General Public License.

This component implements perl-style regular expressions using the
PCRE (Perl-Compatible Regular Expressions) library.  It contains one
class, Regex, as described below.  Currently it's only useful for
matching, and replacing will have to be done in Gambas code... I hope
to provide example Match() and MatchReplace() functions soon.

Synopsis:

dim re as Regex
re = new Regex("stringtosearch","regularexpression")

Regex.Offset: The offset within the string where a match occurred.
Regex.Match: The text that matched the pattern.

If you put parentheses around part of your pattern, and the whole
pattern matches, the parts in parens become submatches.

Regex.SubMatchCount: The number of submatches found.
Regex.SubMatch(i as integer): The text of submatch i.
Regex.SubMatchOffset(i as integer): The offset of submatch i.

Example:

dim i as integer
dim re as Regex
re = new Regex("the quick brown fox","quick(.+)fox")
if re.Offset >= 0 then
   print re.Match
   for i = 1 to re.SubMatchCount
       print re.SubMatch(i)
   next
endif

This should generate the following output:

quick brown fox
 brown 

To compile this component, you must have a Gambas 0.99 source tree
available and place this tarball's contents (the whole pcre directory)
under src/lib in the gambas source tree.  Then you must modify a
number of files in the gambas source tree and rebuild according to the
instructions in:

http://www.binara.com/gambas-wiki/bin/view/Gambas/HowToProgramComponentsQuick 

I'll try to make a Mandrake package of this and announce it on the
gambas-user@sourceforge.net list.

Rob Kudla
pcre-component@kudla.org

Icon  Name                                                                   Last modified      Size  
[DIR] Parent Directory - [DIR] .deps/ 11-Jun-2009 18:53 - [DIR] .svn/ 11-Jun-2009 18:53 - [TXT] Makefile 10-Jun-2009 21:15 18K [   ] Makefile.am 10-Jun-2009 20:29 244 [TXT] Makefile.in 10-Jun-2009 20:34 18K [TXT] README 10-Jun-2009 20:29 1.8K [   ] gb.pcre.component 10-Jun-2009 20:29 216 [TXT] main.c 10-Jun-2009 20:29 1.3K [TXT] main.h 10-Jun-2009 20:29 1.1K [TXT] regexp.c 10-Jun-2009 20:29 10K [TXT] regexp.h 10-Jun-2009 20:29 1.4K

NLUUG - Open Systems. Open Standards
Become a member and get discounts on conferences and more, see the NLUUG website!