gambas-source-code/gb.pcre/src
Benoît Minisini 4623599a9a [DEVELOPMENT ENVIRONMENT]
* NEW: Form editor: Selected controls do not display a frame when they are
  hovered. It is useless.
* NEW: Form editor: The hover frame is now updated when a control is 
  resized.
* NEW: Form editor: Panels with no child and that have their Expand 
  property set now display red hatch lines whose orientation depends on 
  their arrangement of its parent container.
* NEW: The default farm server is now gambasfarm.org.
* NEW: Form editor: Arrangement icons have been redesigned.

[GB.GUI.BASE]
* NEW: ScrollArea shadows are smaller now.

[GB.PCRE]
* BUG: MATCH operator: A void string now only matches a void string.


git-svn-id: svn://localhost/gambas/trunk@6919 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-02-28 15:04:48 +00:00
..
gb.pcre.component
gb.pcre.h
main.c
main.h
Makefile.am
README
regexp.c [DEVELOPMENT ENVIRONMENT] 2015-02-28 15:04:48 +00:00
regexp.h

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