.TH "KRegExp" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KRegExp \- 
.SH SYNOPSIS
.br
.PP
\fC#include <kregexp.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKRegExp\fP ()"
.br
.ti -1c
.RI "\fBKRegExp\fP (const char *_pattern, const char *_mode='')"
.br
.ti -1c
.RI "bool \fBcompile\fP (const char *_pattern, const char *_mode='')"
.br
.ti -1c
.RI "bool \fBmatch\fP (const char *_string)"
.br
.ti -1c
.RI "const char * \fBgroup\fP (int _grp)"
.br
.ti -1c
.RI "int \fBgroupStart\fP (int _grp)"
.br
.ti -1c
.RI "int \fBgroupEnd\fP (int _grp)"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBDeprecated\fP
.RS 4
Please use \fBQRegExp\fP instead. 
.RE
.PP
Regular expression (regexp) matching with back-references.
.PP
This was implemented because \fBQRegExp\fP did not support back-references. It now does and is recommended over KRegExp because of the unicode support and the more powerful API.
.PP
Back-references are parts of a regexp grouped with parentheses. If a string matches the regexp, you can access the text that matched each group with the group method. This is similar to regular expressions in Perl.
.PP
Example: 
.PP
.nf
  KRegExp ex( '([A-Za-z]+) (.+)' );
  ex.match( '42 Torben Weis' );
  kdDebug() << ex.group(0) << endl;
  kdDebug() << ex.group(1) << endl;
  kdDebug() << ex.group(2) << endl;

.fi
.PP
 Output: 
.PP
.nf
  Torben Weis
  Torben
  Weis

.fi
.PP
.PP
Please notice that KRegExp does \fInot\fP support unicode.
.PP
\fBAuthor:\fP
.RS 4
Torben Weis <weis@kde.org> 
.RE
.PP

.PP
Definition at line 60 of file kregexp.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KRegExp::KRegExp ()"
.PP
Creates a KRegExp object without a default pattern. 
.PP
Definition at line 143 of file kregexp.cpp.
.SS "KRegExp::KRegExp (const char * _pattern, const char * _mode = \fC''\fP)"
.PP
Creates a KRegExp object. 
.PP
\fBParameters:\fP
.RS 4
\fI_pattern\fP The regular expression to use for matches. 
.br
\fI_mode\fP If this is 'i', case-insensitive matches will be performed. 
.RE
.PP

.PP
Definition at line 148 of file kregexp.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KRegExp::compile (const char * _pattern, const char * _mode = \fC''\fP)"
.PP
Prepare a regular expression for subsequent matches. 
.PP
\fBParameters:\fP
.RS 4
\fI_pattern\fP The regular expression to use for matches. 
.br
\fI_mode\fP If this is 'i', case-insensitive matches will be performed. 
.RE
.PP
\fBReturns:\fP
.RS 4
bool if successful. 
.RE
.PP

.PP
Definition at line 158 of file kregexp.cpp.
.PP
References KRegExpPrivate::compile().
.SS "bool KRegExp::match (const char * _string)"
.PP
Match a string to the last supplied regexp. 
.PP
\fBParameters:\fP
.RS 4
\fI_string\fP the string to match 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP on match, false otherwise. 
.RE
.PP

.PP
Definition at line 163 of file kregexp.cpp.
.PP
References KRegExpPrivate::match().
.SS "const char * KRegExp::group (int _grp)"
.PP
Returns a group from the match. 
.PP
\fBParameters:\fP
.RS 4
\fI_grp\fP May be in the range [0..9]. If \fC_grp\fP is 0 then the complete matched string is returned. 
.RE
.PP
\fBReturns:\fP
.RS 4
a grouped substring. A substring may be empty. In this case 0 is returned. Otherwise you may \fInot\fP delete or modify the returned value. In addition the returned value becomes invalid after the KRegExp instance is deleted or after \fBmatch()\fP was called again. 
.RE
.PP

.PP
Definition at line 168 of file kregexp.cpp.
.PP
References KRegExpPrivate::group().
.SS "int KRegExp::groupStart (int _grp)"
.PP
The offset of the given group in the string. 
.PP
\fBParameters:\fP
.RS 4
\fI_grp\fP May be in the range [0..9]. If \fC_grp\fP is 0 then the start offset of the complete matched string is returned. 
.RE
.PP
\fBReturns:\fP
.RS 4
The start offset of the grouped substring. 
.RE
.PP

.PP
Definition at line 173 of file kregexp.cpp.
.PP
References KRegExpPrivate::groupStart().
.SS "int KRegExp::groupEnd (int _grp)"
.PP
The offset of the given group's end in the string. 
.PP
\fBParameters:\fP
.RS 4
\fI_grp\fP May be in the range [0..9]. If \fC_grp\fP is 0 then the end offset of the complete matched string is returned. 
.RE
.PP
\fBReturns:\fP
.RS 4
The end offset of the grouped substring. The 'end offset' is the first character after the string. 
.RE
.PP

.PP
Definition at line 178 of file kregexp.cpp.
.PP
References KRegExpPrivate::groupEnd().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
