diff options
Diffstat (limited to 'doc/man/man3/tqregexp.3qt')
-rw-r--r-- | doc/man/man3/tqregexp.3qt | 151 |
1 files changed, 76 insertions, 75 deletions
diff --git a/doc/man/man3/tqregexp.3qt b/doc/man/man3/tqregexp.3qt index 859ce0c21..2077d70f1 100644 --- a/doc/man/man3/tqregexp.3qt +++ b/doc/man/man3/tqregexp.3qt @@ -1,5 +1,5 @@ '\" t -.TH QRegExp 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQRegExp 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,11 +7,11 @@ .ad l .nh .SH NAME -QRegExp \- Pattern matching using regular expressions +TQRegExp \- Pattern matching using regular expressions .SH SYNOPSIS All the functions in this class are reentrant when TQt is built with thread support.</p> .PP -\fC#include <ntqregexp.h>\fR +\fC#include <tqregexp.h>\fR .PP .SS "Public Members" .in +1c @@ -19,25 +19,26 @@ All the functions in this class are reentrant when TQt is built with thread supp .BI "enum \fBCaretMode\fR { CaretAtZero, CaretAtOffset, CaretWontMatch }" .br .ti -1c -.BI "\fBQRegExp\fR ()" +.BI "\fBTQRegExp\fR ()" .br .ti -1c -.BI "\fBQRegExp\fR ( const TQString & pattern, bool caseSensitive = TRUE, bool wildcard = FALSE )" +.BI "\fBTQRegExp\fR ( const TQString & pattern, bool caseSensitive = TRUE, bool wildcard = FALSE )" .br .ti -1c -.BI "\fBQRegExp\fR ( const QRegExp & rx )" + +.BI "\fBTQRegExp\fR ( const TQRegExp & rx )" .br .ti -1c -.BI "\fB~QRegExp\fR ()" +.BI "\fB~TQRegExp\fR ()" .br .ti -1c -.BI "QRegExp & \fBoperator=\fR ( const QRegExp & rx )" +.BI "TQRegExp & \fBoperator=\fR ( const TQRegExp & rx )" .br .ti -1c -.BI "bool \fBoperator==\fR ( const QRegExp & rx ) const" +.BI "bool \fBoperator==\fR ( const TQRegExp & rx ) const" .br .ti -1c -.BI "bool \fBoperator!=\fR ( const QRegExp & rx ) const" +.BI "bool \fBoperator!=\fR ( const TQRegExp & rx ) const" .br .ti -1c .BI "bool \fBisEmpty\fR () const" @@ -107,7 +108,7 @@ All the functions in this class are reentrant when TQt is built with thread supp .br .in -1c .SH DESCRIPTION -The QRegExp class provides pattern matching using regular expressions. +The TQRegExp class provides pattern matching using regular expressions. .PP .PP @@ -120,11 +121,11 @@ l - l. Validation A regexp can be used to check whether a piece of text meets so .fi </center> .PP -We present a very brief introduction to regexps, a description of Qt's regexp language, some code examples, and finally the function documentation itself. QRegExp is modeled on Perl's regexp language, and also fully supports Unicode. QRegExp can also be used in the weaker 'wildcard' (globbing) mode which works in a similar way to command shells. A good text on regexps is \fIMastering Regular Expressions: Powerful Techniques for Perl and Other Tools\fR by Jeffrey E. Friedl, ISBN 1565922573. +We present a very brief introduction to regexps, a description of Qt's regexp language, some code examples, and finally the function documentation itself. TQRegExp is modeled on Perl's regexp language, and also fully supports Unicode. TQRegExp can also be used in the weaker 'wildcard' (globbing) mode which works in a similar way to command shells. A good text on regexps is \fIMastering Regular Expressions: Powerful Techniques for Perl and Other Tools\fR by Jeffrey E. Friedl, ISBN 1565922573. .PP Experienced regexp users may prefer to skip the introduction and go directly to the relevant information. .PP -In case of multi-threaded programming, note that QRegExp depends on TQThreadStorage internally. For that reason, QRegExp should only be used with threads started with TQThread, i.e. not with threads started with platform-specific APIs. +In case of multi-threaded programming, note that TQRegExp depends on TQThreadStorage internally. For that reason, TQRegExp should only be used with threads started with TQThread, i.e. not with threads started with platform-specific APIs. .PP .TP @@ -281,15 +282,15 @@ same as .PP For example if we are in wildcard mode and have strings which contain filenames we could identify HTML files with \fB*.html\fR. This will match zero or more characters followed by a dot followed by 'h', 't', 'm' and 'l'. .SH "Notes for Perl Users" -Most of the character class abbreviations supported by Perl are supported by QRegExp, see characters and abbreviations for sets of characters. +Most of the character class abbreviations supported by Perl are supported by TQRegExp, see characters and abbreviations for sets of characters. .PP -In QRegExp, apart from within character classes, \fC^\fR always signifies the start of the string, so carets must always be escaped unless used for that purpose. In Perl the meaning of caret varies automagically depending on where it occurs so escaping it is rarely necessary. The same applies to \fC$\fR which in QRegExp always signifies the end of the string. +In TQRegExp, apart from within character classes, \fC^\fR always signifies the start of the string, so carets must always be escaped unless used for that purpose. In Perl the meaning of caret varies automagically depending on where it occurs so escaping it is rarely necessary. The same applies to \fC$\fR which in TQRegExp always signifies the end of the string. .PP -QRegExp's quantifiers are the same as Perl's greedy quantifiers. Non-greedy matching cannot be applied to individual quantifiers, but can be applied to all the quantifiers in the pattern. For example, to match the Perl regexp \fBro+?m\fR requires: +TQRegExp's quantifiers are the same as Perl's greedy quantifiers. Non-greedy matching cannot be applied to individual quantifiers, but can be applied to all the quantifiers in the pattern. For example, to match the Perl regexp \fBro+?m\fR requires: .PP .nf .br - QRegExp rx( "ro+m" ); + TQRegExp rx( "ro+m" ); .br rx.setMinimal( TRUE ); .br @@ -299,11 +300,11 @@ The equivalent of Perl's \fC/i\fR option is setCaseSensitive(FALSE). .PP Perl's \fC/g\fR option can be emulated using a loop. .PP -In QRegExp \fB.\fR matches any character, therefore all QRegExp regexps have the equivalent of Perl's \fC/s\fR option. QRegExp does not have an equivalent to Perl's \fC/m\fR option, but this can be emulated in various ways for example by splitting the input into lines or by looping with a regexp that searches for newlines. +In TQRegExp \fB.\fR matches any character, therefore all TQRegExp regexps have the equivalent of Perl's \fC/s\fR option. TQRegExp does not have an equivalent to Perl's \fC/m\fR option, but this can be emulated in various ways for example by splitting the input into lines or by looping with a regexp that searches for newlines. .PP -Because QRegExp is string oriented there are no \\A, \\Z or \\z assertions. The \\G assertion is not supported but can be emulated in a loop. +Because TQRegExp is string oriented there are no \\A, \\Z or \\z assertions. The \\G assertion is not supported but can be emulated in a loop. .PP -Perl's $& is cap(0) or capturedTexts()[0]. There are no QRegExp equivalents for $`, $' or $+. Perl's capturing variables, $1, $2, +Perl's $& is cap(0) or capturedTexts()[0]. There are no TQRegExp equivalents for $`, $' or $+. Perl's capturing variables, $1, $2, ... correspond to cap(1) or capturedTexts()[1], cap(2) or capturedTexts()[2], etc. .PP @@ -313,7 +314,7 @@ Perl's extended \fC/x\fR syntax is not supported, nor are directives, e.g. (?i), .PP .nf .br - QRegExp mark( "\\\\b" // word boundary + TQRegExp mark( "\\\\b" // word boundary .br "[Mm]ark" // the word we want to match .br @@ -331,7 +332,7 @@ Note: because C++ transforms \'s they must be written \fItwice\fR in code, e .SH "Code Examples" .nf .br - QRegExp rx( "^\\\\d\\\\d?$" ); // match integers 0 to 99 + TQRegExp rx( "^\\\\d\\\\d?$" ); // match integers 0 to 99 .br rx.search( "123" ); // returns -1 (no match) .br @@ -345,7 +346,7 @@ The third string matches '<u>6</u>'. This is a simple validation regexp for inte .PP .nf .br - QRegExp rx( "^\\\\S+$" ); // match strings without whitespace + TQRegExp rx( "^\\\\S+$" ); // match strings without whitespace .br rx.search( "Hello world" ); // returns -1 (no match) .br @@ -359,7 +360,7 @@ In the following example we match strings containing 'mail' or 'letter' or 'corr .PP .nf .br - QRegExp rx( "\\\\b(mail|letter|correspondence)\\\\b" ); + TQRegExp rx( "\\\\b(mail|letter|correspondence)\\\\b" ); .br rx.search( "I sent you an email" ); // returns -1 (no match) .br @@ -379,7 +380,7 @@ This will capture the text from the first set of capturing parentheses (counting .PP .nf .br - QRegExp rx( "&(?!amp;)" ); // match ampersands but not & + TQRegExp rx( "&(?!amp;)" ); // match ampersands but not & .br TQString line1 = "This & that"; .br @@ -395,7 +396,7 @@ This will capture the text from the first set of capturing parentheses (counting .br .fi .PP -Here we've passed the QRegExp to TQString's replace() function to replace the matched text with new text. +Here we've passed the TQRegExp to TQString's replace() function to replace the matched text with new text. .PP .nf .br @@ -403,7 +404,7 @@ Here we've passed the QRegExp to TQString's replace() function to replace the ma .br " How many Eiriks, Eric?"; .br - QRegExp rx( "\\\\b(Eric|Eirik)\\\\b" ); // match Eric or Eirik + TQRegExp rx( "\\\\b(Eric|Eirik)\\\\b" ); // match Eric or Eirik .br int pos = 0; // where we are in the string .br @@ -463,7 +464,7 @@ To imitate the matching of a shell we can use wildcard mode. .PP .nf .br - QRegExp rx( "*.html" ); // invalid regexp: * doesn't quantify anything + TQRegExp rx( "*.html" ); // invalid regexp: * doesn't quantify anything .br rx.setWildcard( TRUE ); // now it's a valid wildcard regexp .br @@ -477,40 +478,40 @@ To imitate the matching of a shell we can use wildcard mode. .PP Wildcard matching can be convenient because of its simplicity, but any wildcard regexp can be defined using full regexps, e.g. \fB.*\.html$\fR. Notice that we can't match both \fC.html\fR and \fC.htm\fR files with a wildcard unless we use \fB*.htm*\fR which will also match 'test.html.bak'. A full regexp gives us the precision we need, \fB.*\.html?$\fR. .PP -QRegExp can match case insensitively using setCaseSensitive(), and can use non-greedy matching, see setMinimal(). By default QRegExp uses full regexps but this can be changed with setWildcard(). Searching can be forward with search() or backward with searchRev(). Captured text can be accessed using capturedTexts() which returns a string list of all captured strings, or using cap() which returns the captured string for the given index. The pos() function takes a match index and returns the position in the string where the match was made (or -1 if there was no match). +TQRegExp can match case insensitively using setCaseSensitive(), and can use non-greedy matching, see setMinimal(). By default TQRegExp uses full regexps but this can be changed with setWildcard(). Searching can be forward with search() or backward with searchRev(). Captured text can be accessed using capturedTexts() which returns a string list of all captured strings, or using cap() which returns the captured string for the given index. The pos() function takes a match index and returns the position in the string where the match was made (or -1 if there was no match). .PP -See also QRegExpValidator, TQString, TQStringList, Miscellaneous Classes, Implicitly and Explicitly Shared Classes, and Non-GUI Classes. +See also TQRegExpValidator, TQString, TQStringList, Miscellaneous Classes, Implicitly and Explicitly Shared Classes, and Non-GUI Classes. .PP .SS "Member Type Documentation" -.SH "QRegExp::CaretMode" +.SH "TQRegExp::CaretMode" The CaretMode enum defines the different meanings of the caret (\fB^\fR) in a regular expression. The possible values are: .TP -\fCQRegExp::CaretAtZero\fR - The caret corresponds to index 0 in the searched string. +\fCTQRegExp::CaretAtZero\fR - The caret corresponds to index 0 in the searched string. .TP -\fCQRegExp::CaretAtOffset\fR - The caret corresponds to the start offset of the search. +\fCTQRegExp::CaretAtOffset\fR - The caret corresponds to the start offset of the search. .TP -\fCQRegExp::CaretWontMatch\fR - The caret never matches. +\fCTQRegExp::CaretWontMatch\fR - The caret never matches. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QRegExp::QRegExp ()" +.SH "TQRegExp::TQRegExp ()" Constructs an empty regexp. .PP See also isValid() and errorString(). -.SH "QRegExp::QRegExp ( const TQString & pattern, bool caseSensitive = TRUE, bool wildcard = FALSE )" +.SH "TQRegExp::TQRegExp ( const TQString & pattern, bool caseSensitive = TRUE, bool wildcard = FALSE )" Constructs a regular expression object for the given \fIpattern\fR string. The pattern must be given using wildcard notation if \fIwildcard\fR is TRUE (default is FALSE). The pattern is case sensitive, unless \fIcaseSensitive\fR is FALSE. Matching is greedy (maximal), but can be changed by calling setMinimal(). .PP See also setPattern(), setCaseSensitive(), setWildcard(), and setMinimal(). -.SH "QRegExp::QRegExp ( const QRegExp & rx )" +.SH "TQRegExp::TQRegExp ( const TQRegExp & rx )" Constructs a regular expression as a copy of \fIrx\fR. .PP See also operator=(). -.SH "QRegExp::~QRegExp ()" +.SH "TQRegExp::~TQRegExp ()" Destroys the regular expression and cleans up its internal data. -.SH "TQString QRegExp::cap ( int nth = 0 )" +.SH "TQString TQRegExp::cap ( int nth = 0 )" Returns the text captured by the \fInth\fR subexpression. The entire match has index 0 and the parenthesized subexpressions have indices starting from 1 (excluding non-capturing parentheses). .PP .nf .br - QRegExp rxlen( "(\\\\d+)(?:\\\\s*)(cm|inch)" ); + TQRegExp rxlen( "(\\\\d+)(?:\\\\s*)(cm|inch)" ); .br int pos = rxlen.search( "Length: 189cm" ); .br @@ -532,7 +533,7 @@ Some patterns may lead to a number of matches which cannot be determined in adva .PP .nf .br - QRegExp rx( "(\\\\d+)" ); + TQRegExp rx( "(\\\\d+)" ); .br str = "Offsets: 12 14 99 231 7"; .br @@ -562,7 +563,7 @@ See also capturedTexts(), pos(), exactMatch(), search(), and searchRev(). .PP Examples: .)l network/archivesearch/archivedialog.ui.h and regexptester/regexptester.cpp. -.SH "TQStringList QRegExp::capturedTexts ()" +.SH "TQStringList TQRegExp::capturedTexts ()" Returns a list of the captured text strings. .PP The first string in the list is the entire matched string. Each subsequent list element contains a string that matched a (capturing) subexpression of the regexp. @@ -571,7 +572,7 @@ For example: .PP .nf .br - QRegExp rx( "(\\\\d+)(\\\\s*)(cm|inch(es)?)" ); + TQRegExp rx( "(\\\\d+)(\\\\s*)(cm|inch(es)?)" ); .br int pos = rx.search( "Length: 36 inches" ); .br @@ -585,7 +586,7 @@ The above example also captures elements that may be present but which we have n .PP .nf .br - QRegExp rx( "(\\\\d+)(?:\\\\s*)(cm|inch(?:es)?)" ); + TQRegExp rx( "(\\\\d+)(?:\\\\s*)(cm|inch(?:es)?)" ); .br int pos = rx.search( "Length: 36 inches" ); .br @@ -618,17 +619,17 @@ Some regexps can match an indeterminate number of times. For example if the inpu The order of elements in the string list is as follows. The first element is the entire matching string. Each subsequent element corresponds to the next capturing open left parentheses. Thus capturedTexts()[1] is the text of the first capturing parentheses, capturedTexts()[2] is the text of the second and so on (corresponding to $1, $2, etc., in some other regexp languages). .PP See also cap(), pos(), exactMatch(), search(), and searchRev(). -.SH "bool QRegExp::caseSensitive () const" +.SH "bool TQRegExp::caseSensitive () const" Returns TRUE if case sensitivity is enabled; otherwise returns FALSE. The default is TRUE. .PP See also setCaseSensitive(). -.SH "TQString QRegExp::errorString ()" +.SH "TQString TQRegExp::errorString ()" Returns a text string that explains why a regexp pattern is invalid the case being; otherwise returns "no error occurred". .PP See also isValid(). .PP Example: regexptester/regexptester.cpp. -.SH "TQString QRegExp::escape ( const TQString & str )\fC [static]\fR" +.SH "TQString TQRegExp::escape ( const TQString & str )\fC [static]\fR" Returns the string \fIstr\fR with every regexp special character escaped with a backslash. The special characters are $, (, ), *, +, ., ?, [, \, ], ^, {, | and }. .PP @@ -636,9 +637,9 @@ Example: .PP .nf .br - s1 = QRegExp::escape( "bingo" ); // s1 == "bingo" + s1 = TQRegExp::escape( "bingo" ); // s1 == "bingo" .br - s2 = QRegExp::escape( "f(x)" ); // s2 == "f\\\\(x\\\\)" + s2 = TQRegExp::escape( "f(x)" ); // s2 == "f\\\\(x\\\\)" .br .fi .PP @@ -646,12 +647,12 @@ This function is useful to construct regexp patterns dynamically: .PP .nf .br - QRegExp rx( "(" + QRegExp::escape(name) + + TQRegExp rx( "(" + TQRegExp::escape(name) + .br - "|" + QRegExp::escape(alias) + ")" ); + "|" + TQRegExp::escape(alias) + ")" ); .br .fi -.SH "bool QRegExp::exactMatch ( const TQString & str ) const" +.SH "bool TQRegExp::exactMatch ( const TQString & str ) const" Returns TRUE if \fIstr\fR is matched exactly by this regular expression; otherwise returns FALSE. You can determine how much of the string was matched by calling matchedLength(). .PP For a given regexp string, R, exactMatch("R") is the equivalent of search("^R$") since exactMatch() effectively encloses the regexp in the start of string and end of string anchors, except that it sets matchedLength() differently. @@ -660,14 +661,14 @@ For example, if the regular expression is \fBblue\fR, then exactMatch() returns .PP Although const, this function sets matchedLength(), capturedTexts() and pos(). .PP -See also search(), searchRev(), and QRegExpValidator. -.SH "bool QRegExp::isEmpty () const" +See also search(), searchRev(), and TQRegExpValidator. +.SH "bool TQRegExp::isEmpty () const" Returns TRUE if the pattern string is empty; otherwise returns FALSE. .PP If you call exactMatch() with an empty pattern on an empty string it will return TRUE; otherwise it returns FALSE since it operates over the whole string. If you call search() with an empty pattern on \fIany\fR string it will return the start offset (0 by default) because the empty pattern matches the 'emptiness' at the start of the string. In this case the length of the match returned by matchedLength() will be 0. .PP See TQString::isEmpty(). -.SH "bool QRegExp::isValid () const" +.SH "bool TQRegExp::isValid () const" Returns TRUE if the regular expression is valid; otherwise returns FALSE. An invalid regular expression never matches. .PP The pattern \fB[a-z\fR is an example of an invalid pattern, since it lacks a closing square bracket. @@ -677,7 +678,7 @@ Note that the validity of a regexp may also depend on the setting of the wildcar See also errorString(). .PP Example: regexptester/regexptester.cpp. -.SH "int QRegExp::match ( const TQString & str, int index = 0, int * len = 0, bool indexIsStart = TRUE ) const" +.SH "int TQRegExp::match ( const TQString & str, int index = 0, int * len = 0, bool indexIsStart = TRUE ) const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Attempts to match in \fIstr\fR, starting from position \fIindex\fR. Returns the position of the match, or -1 if there was no match. @@ -691,43 +692,43 @@ Use search() and matchedLength() instead of this function. See also TQString::mid() and QConstString. .PP Example: qmag/qmag.cpp. -.SH "int QRegExp::matchedLength () const" +.SH "int TQRegExp::matchedLength () const" Returns the length of the last matched string, or -1 if there was no match. .PP See also exactMatch(), search(), and searchRev(). .PP Examples: .)l network/archivesearch/archivedialog.ui.h and regexptester/regexptester.cpp. -.SH "bool QRegExp::minimal () const" +.SH "bool TQRegExp::minimal () const" Returns TRUE if minimal (non-greedy) matching is enabled; otherwise returns FALSE. .PP See also setMinimal(). -.SH "int QRegExp::numCaptures () const" +.SH "int TQRegExp::numCaptures () const" Returns the number of captures contained in the regular expression. .PP Example: regexptester/regexptester.cpp. -.SH "bool QRegExp::operator!= ( const QRegExp & rx ) const" +.SH "bool TQRegExp::operator!= ( const TQRegExp & rx ) const" Returns TRUE if this regular expression is not equal to \fIrx\fR; otherwise returns FALSE. .PP See also operator==(). -.SH "QRegExp & QRegExp::operator= ( const QRegExp & rx )" +.SH "TQRegExp & TQRegExp::operator= ( const TQRegExp & rx )" Copies the regular expression \fIrx\fR and returns a reference to the copy. The case sensitivity, wildcard and minimal matching options are also copied. -.SH "bool QRegExp::operator== ( const QRegExp & rx ) const" +.SH "bool TQRegExp::operator== ( const TQRegExp & rx ) const" Returns TRUE if this regular expression is equal to \fIrx\fR; otherwise returns FALSE. .PP -Two QRegExp objects are equal if they have the same pattern strings and the same settings for case sensitivity, wildcard and minimal matching. -.SH "TQString QRegExp::pattern () const" +Two TQRegExp objects are equal if they have the same pattern strings and the same settings for case sensitivity, wildcard and minimal matching. +.SH "TQString TQRegExp::pattern () const" Returns the pattern string of the regular expression. The pattern has either regular expression syntax or wildcard syntax, depending on wildcard(). .PP See also setPattern(). -.SH "int QRegExp::pos ( int nth = 0 )" +.SH "int TQRegExp::pos ( int nth = 0 )" Returns the position of the \fInth\fR captured text in the searched string. If \fInth\fR is 0 (the default), pos() returns the position of the whole match. .PP Example: .PP .nf .br - QRegExp rx( "/([a-z]+)/([a-z]+)" ); + TQRegExp rx( "/([a-z]+)/([a-z]+)" ); .br rx.search( "Output /dev/null" ); // returns 7 (position of /dev/null) .br @@ -742,7 +743,7 @@ Example: For zero-length matches, pos() always returns -1. (For example, if cap(4) would return an empty string, pos(4) returns -1.) This is due to an implementation tradeoff. .PP See also capturedTexts(), exactMatch(), search(), and searchRev(). -.SH "int QRegExp::search ( const TQString & str, int offset = 0, CaretMode caretMode = CaretAtZero ) const" +.SH "int TQRegExp::search ( const TQString & str, int offset = 0, CaretMode caretMode = CaretAtZero ) const" Attempts to find a match in \fIstr\fR from position \fIoffset\fR (0 by default). If \fIoffset\fR is -1, the search starts at the last character; if -2, at the next to last character; etc. .PP Returns the position of the first match, or -1 if there was no match. @@ -757,7 +758,7 @@ Example: .br TQString str = "offsets: 1.23 .50 71.00 6.00"; .br - QRegExp rx( "\\\\d*\\\\.\\\\d+" ); // primitive floating point matching + TQRegExp rx( "\\\\d*\\\\.\\\\d+" ); // primitive floating point matching .br int count = 0; .br @@ -781,7 +782,7 @@ See also searchRev() and exactMatch(). .PP Examples: .)l network/archivesearch/archivedialog.ui.h and regexptester/regexptester.cpp. -.SH "int QRegExp::searchRev ( const TQString & str, int offset = -1, CaretMode caretMode = CaretAtZero ) const" +.SH "int TQRegExp::searchRev ( const TQString & str, int offset = -1, CaretMode caretMode = CaretAtZero ) const" Attempts to find a match backwards in \fIstr\fR from position \fIoffset\fR. If \fIoffset\fR is -1 (the default), the search starts at the last character; if -2, at the next to last character; etc. .PP Returns the position of the first match, or -1 if there was no match. @@ -793,7 +794,7 @@ Although const, this function sets matchedLength(), capturedTexts() and pos(). \fBWarning:\fR Searching backwards is much slower than searching forwards. .PP See also search() and exactMatch(). -.SH "void QRegExp::setCaseSensitive ( bool sensitive )" +.SH "void TQRegExp::setCaseSensitive ( bool sensitive )" Sets case sensitive matching to \fIsensitive\fR. .PP If \fIsensitive\fR is TRUE, \fB\.txt$\fR matches \fCreadme.txt\fR but not \fCREADME.TXT\fR. @@ -801,7 +802,7 @@ If \fIsensitive\fR is TRUE, \fB\.txt$\fR matches \fCreadme.txt\fR but not \f See also caseSensitive(). .PP Example: regexptester/regexptester.cpp. -.SH "void QRegExp::setMinimal ( bool minimal )" +.SH "void TQRegExp::setMinimal ( bool minimal )" Enables or disables minimal matching. If \fIminimal\fR is FALSE, matching is greedy (maximal) which is the default. .PP For example, suppose we have the input string "We must be <b>bold</b>, very <b>bold</b>!" and the pattern \fB<b>.*</b>\fR. With the default greedy (maximal) matching, the match is "We must be <u><b>bold</b>, very <b>bold</b></u>!". But with minimal (non-greedy) matching the first match is: "We must be <u><b>bold</b></u>, very <b>bold</b>!" and the second match is "We must be <b>bold</b>, very <u><b>bold</b></u>!". In practice we might use the pattern \fB<b>[^<]+</b>\fR instead, although this will still fail for nested tags. @@ -810,11 +811,11 @@ See also minimal(). .PP Examples: .)l network/archivesearch/archivedialog.ui.h and regexptester/regexptester.cpp. -.SH "void QRegExp::setPattern ( const TQString & pattern )" +.SH "void TQRegExp::setPattern ( const TQString & pattern )" Sets the pattern string to \fIpattern\fR. The case sensitivity, wildcard and minimal matching options are not changed. .PP See also pattern(). -.SH "void QRegExp::setWildcard ( bool wildcard )" +.SH "void TQRegExp::setWildcard ( bool wildcard )" Sets the wildcard mode for the regular expression. The default is FALSE. .PP Setting \fIwildcard\fR to TRUE enables simple shell-like wildcard matching. (See wildcard matching (globbing).) @@ -824,13 +825,13 @@ For example, \fBr*.txt\fR matches the string \fCreadme.txt\fR in wildcard mode, See also wildcard(). .PP Example: regexptester/regexptester.cpp. -.SH "bool QRegExp::wildcard () const" +.SH "bool TQRegExp::wildcard () const" Returns TRUE if wildcard mode is enabled; otherwise returns FALSE. The default is FALSE. .PP See also setWildcard(). .SH "SEE ALSO" -.BR http://doc.trolltech.com/ntqregexp.html +.BR http://doc.trolltech.com/tqregexp.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the |