gambas-source-code/gb.pcre/src
gambas 09a0573e61 Replace my old sourceforge mail address by the new one.
[CONFIGURATION]
Replace my old sourceforge mail address by the new one.
2018-02-12 02:53:46 +01:00
..
gb.pcre.component [DEVELOPMENT ENVIRONMENT] 2011-02-27 09:13:32 +00:00
gb.pcre.h Replace my old sourceforge mail address by the new one. 2018-02-12 02:53:46 +01:00
main.c Replace my old sourceforge mail address by the new one. 2018-02-12 02:53:46 +01:00
main.h Replace my old sourceforge mail address by the new one. 2018-02-12 02:53:46 +01:00
Makefile.am [INTERPRETER] 2013-07-12 23:57:53 +00:00
README * Copy https://gambas.svn.sourceforge.net/svnroot/gambas/2.0 to https://gambas.svn.sourceforge.net/svnroot/gambas/gambas 2007-12-30 16:41:49 +00:00
regexp.c Replace my old sourceforge mail address by the new one. 2018-02-12 02:53:46 +01:00
regexp.h Replace my old sourceforge mail address by the new one. 2018-02-12 02:53:46 +01:00

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