vgritsenko 2004/02/26 18:18:01 Modified: docs changes.html src/java/org/apache/regexp RE.java xdocs changes.xml Log: Fix bug #2121: add some javadoc Revision Changes Path 1.21 +3 -0 jakarta-regexp/docs/changes.html Index: changes.html =================================================================== RCS file: /home/cvs/jakarta-regexp/docs/changes.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- changes.html 17 Feb 2004 13:37:54 -0000 1.20 +++ changes.html 27 Feb 2004 02:18:01 -0000 1.21 @@ -87,6 +87,9 @@ </p> <h3>Version 1.4-dev</h3> <ul> +<li>Fixed Bug + <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2121">2121</a>: + '.' or '-' in bracket expression gives unexpected results (VG)</li> <li>Regexp is relicensed to <a href="http://www.apache.org/licenses/LICENSE-2.0"> Apache License, Version 2.0</a> (VG)</li> <li>Fixed Bug 1.20 +13 -63 jakarta-regexp/src/java/org/apache/regexp/RE.java Index: RE.java =================================================================== RCS file: /home/cvs/jakarta-regexp/src/java/org/apache/regexp/RE.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- RE.java 17 Feb 2004 13:37:54 -0000 1.19 +++ RE.java 27 Feb 2004 02:18:01 -0000 1.20 @@ -28,25 +28,19 @@ * syntax of regular expression patterns are given below. * * <p> - * * To compile a regular expression (RE), you can simply construct an RE * matcher object from the string specification of the pattern, like this: * * <pre> - * * RE r = new RE("a*b"); - * * </pre> * * <p> - * * Once you have done this, you can call either of the RE.match methods to * perform matching on a String. For example: * * <pre> - * * boolean matched = r.match("aaaab"); - * * </pre> * * will cause the boolean matched to be set to true because the @@ -59,27 +53,19 @@ * something like "xaaaab", you would get results like this: * * <pre> - * * RE r = new RE("(a*)b"); // Compile expression * boolean matched = r.match("xaaaab"); // Match against "xaaaab" * - * <br> - * * String wholeExpr = r.getParen(0); // wholeExpr will be 'aaaab' * String insideParens = r.getParen(1); // insideParens will be 'aaaa' * - * <br> - * - * int startWholeExpr = r.getParenStart(0); // startWholeExpr will be index 1 - * int endWholeExpr = r.getParenEnd(0); // endWholeExpr will be index 6 - * int lenWholeExpr = r.getParenLength(0); // lenWholeExpr will be 5 - * - * <br> + * int startWholeExpr = r.getParenStart(0); // startWholeExpr will be index 1 + * int endWholeExpr = r.getParenEnd(0); // endWholeExpr will be index 6 + * int lenWholeExpr = r.getParenLength(0); // lenWholeExpr will be 5 * * int startInside = r.getParenStart(1); // startInside will be index 1 * int endInside = r.getParenEnd(1); // endInside will be index 5 * int lenInside = r.getParenLength(1); // lenInside will be 4 - * * </pre> * * You can also refer to the contents of a parenthesized expression @@ -88,25 +74,18 @@ * denoted by \1, the second by \2 and so on. So the expression: * * <pre> - * * ([0-9]+)=\1 - * * </pre> * * will match any string of the form n=n (like 0=0 or 2=2). * * <p> - * * The full regular expression syntax accepted by RE is described here: * * <pre> * - * <br> - * * <b><font face=times roman>Characters</font></b> * - * <br> - * * <i>unicodeChar</i> Matches any identical unicode character * \ Used to quote a meta-character (like '*') * \\ Matches a single '\' character @@ -118,21 +97,23 @@ * \r Matches an ASCII return character * \f Matches an ASCII form feed character * - * <br> * * <b><font face=times roman>Character Classes</font></b> * - * <br> - * * [abc] Simple character class * [a-zA-Z] Character class with ranges * [^abc] Negated character class + * </pre> * + * <b>NOTE:</b> Incomplete ranges will be interpreted as "starts + * from zero" or "ends with last character". * <br> + * I.e. [-a] is the same as [\\u0000-a], and [a-] is the same as [a-\\uFFFF], + * [-] means "all characters". * - * <b><font face=times roman>Standard POSIX Character Classes</font></b> + * <pre> * - * <br> + * <b><font face=times roman>Standard POSIX Character Classes</font></b> * * [:alnum:] Alphanumeric characters. * [:alpha:] Alphabetic characters. @@ -152,22 +133,15 @@ * [:upper:] Upper-case alphabetic characters. * [:xdigit:] Characters that are hexadecimal digits. * - * <br> - * - * <b><font face=times roman>Non-standard POSIX-style Character - * Classes</font></b> * - * <br> + * <b><font face=times roman>Non-standard POSIX-style Character Classes</font></b> * * [:javastart:] Start of a Java identifier * [:javapart:] Part of a Java identifier * - * <br> * * <b><font face=times roman>Predefined Classes</font></b> * - * <br> - * * . Matches any character other than newline * \w Matches a "word" character (alphanumeric plus "_") * \W Matches a non-word character @@ -176,23 +150,17 @@ * \d Matches a digit character * \D Matches a non-digit character * - * <br> * * <b><font face=times roman>Boundary Matchers</font></b> * - * <br> - * * ^ Matches only at the beginning of a line * $ Matches only at the end of a line * \b Matches only at a word boundary * \B Matches only at a non-word boundary * - * <br> * * <b><font face=times roman>Greedy Closures</font></b> * - * <br> - * * A* Matches A 0 or more times (greedy) * A+ Matches A 1 or more times (greedy) * A? Matches A 1 or 0 times (greedy) @@ -200,34 +168,25 @@ * A{n,} Matches A at least n times (greedy) * A{n,m} Matches A at least n but not more than m times (greedy) * - * <br> * * <b><font face=times roman>Reluctant Closures</font></b> * - * <br> - * * A*? Matches A 0 or more times (reluctant) * A+? Matches A 1 or more times (reluctant) * A?? Matches A 0 or 1 times (reluctant) * - * <br> * * <b><font face=times roman>Logical Operators</font></b> * - * <br> - * * AB Matches A followed by B * A|B Matches either A or B * (A) Used for subexpression grouping * (?:A) Used for subexpression clustering (just like grouping but * no backrefs) * - * <br> * * <b><font face=times roman>Backreferences</font></b> * - * <br> - * * \1 Backreference to 1st parenthesized subexpression * \2 Backreference to 2nd parenthesized subexpression * \3 Backreference to 3rd parenthesized subexpression @@ -237,13 +196,9 @@ * \7 Backreference to 7th parenthesized subexpression * \8 Backreference to 8th parenthesized subexpression * \9 Backreference to 9th parenthesized subexpression - * - * <br> - * * </pre> * * <p> - * * All closure operators (+, *, ?, {m,n}) are greedy by default, meaning * that they match as many elements of the string as possible without * causing the overall match to fail. If you want a closure to be @@ -253,7 +208,6 @@ * support reluctancy. * * <p> - * * <b><font face="times roman">Line terminators</font></b> * <br> * A line terminator is a one- or two-character sequence that marks @@ -276,7 +230,6 @@ * from the command line to produce compiled output like this: * * <pre> - * * // Pre-compiled regular expression "a*b" * char[] re1Instructions = * { @@ -287,10 +240,8 @@ * 0x0000, * }; * - * <br> * * REProgram re1 = new REProgram(re1Instructions); - * * </pre> * * You can then construct a regular expression matcher (RE) object from @@ -305,10 +256,9 @@ * matcher object for each thread (unless you do thread synchronization * yourself). * - * </pre> * <br><p><br> * - * <font color=red> + * <font color="red"> * <i>ISSUES:</i> * * <ul> 1.21 +4 -1 jakarta-regexp/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/jakarta-regexp/xdocs/changes.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- changes.xml 17 Feb 2004 13:37:54 -0000 1.20 +++ changes.xml 27 Feb 2004 02:18:01 -0000 1.21 @@ -35,6 +35,9 @@ <h3>Version 1.4-dev</h3> <ul> +<li>Fixed Bug + <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2121">2121</a>: + '.' or '-' in bracket expression gives unexpected results (VG)</li> <li>Regexp is relicensed to <a href="http://www.apache.org/licenses/LICENSE-2.0"> Apache License, Version 2.0</a> (VG)</li> <li>Fixed Bug
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]