src/share/classes/java/util/regex/Matcher.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 27,37 **** import java.util.Objects; /** * An engine that performs match operations on a {@link java.lang.CharSequence ! * </code>character sequence<code>} by interpreting a {@link Pattern}. * * <p> A matcher is created from a pattern by invoking the pattern's {@link * Pattern#matcher matcher} method. Once created, a matcher can be used to * perform three different kinds of match operations: * --- 27,37 ---- import java.util.Objects; /** * An engine that performs match operations on a {@link java.lang.CharSequence ! * character sequence} by interpreting a {@link Pattern}. * * <p> A matcher is created from a pattern by invoking the pattern's {@link * Pattern#matcher matcher} method. Once created, a matcher can be used to * perform three different kinds of match operations: *
*** 328,338 **** text = input; return reset(); } /** ! * Returns the start index of the previous match. </p> * * @return The index of the first character matched * * @throws IllegalStateException * If no match has yet been attempted, --- 328,338 ---- text = input; return reset(); } /** ! * Returns the start index of the previous match. * * @return The index of the first character matched * * @throws IllegalStateException * If no match has yet been attempted,
*** 400,410 **** public int start(String name) { return groups[getMatchedGroupIndex(name) * 2]; } /** ! * Returns the offset after the last character matched. </p> * * @return The offset after the last character matched * * @throws IllegalStateException * If no match has yet been attempted, --- 400,410 ---- public int start(String name) { return groups[getMatchedGroupIndex(name) * 2]; } /** ! * Returns the offset after the last character matched. * * @return The offset after the last character matched * * @throws IllegalStateException * If no match has yet been attempted,
*** 645,654 **** --- 645,655 ---- * <p> If the match succeeds then more information can be obtained via the * <tt>start</tt>, <tt>end</tt>, and <tt>group</tt> methods, and subsequent * invocations of the {@link #find()} method will start at the first * character not matched by this match. </p> * + * @param start the index to start searching for a match * @throws IndexOutOfBoundsException * If start is less than zero or if start is greater than the * length of the input sequence. * * @return <tt>true</tt> if, and only if, a subsequence of the input
*** 734,745 **** * * <p> The replacement string may contain references to subsequences * captured during the previous match: Each occurrence of * <tt>${</tt><i>name</i><tt>}</tt> or <tt>$</tt><i>g</i> * will be replaced by the result of evaluating the corresponding ! * {@link #group(String) group(name)} or {@link #group(int) group(g)</tt>} ! * respectively. For <tt>$</tt><i>g</i><tt></tt>, * the first number after the <tt>$</tt> is always treated as part of * the group reference. Subsequent numbers are incorporated into g if * they would form a legal group reference. Only the numerals '0' * through '9' are considered as potential components of the group * reference. If the second group matched the string <tt>"foo"</tt>, for --- 735,746 ---- * * <p> The replacement string may contain references to subsequences * captured during the previous match: Each occurrence of * <tt>${</tt><i>name</i><tt>}</tt> or <tt>$</tt><i>g</i> * will be replaced by the result of evaluating the corresponding ! * {@link #group(String) group(name)} or {@link #group(int) group(g)} ! * respectively. For <tt>$</tt><i>g</i>, * the first number after the <tt>$</tt> is always treated as part of * the group reference. Subsequent numbers are incorporated into g if * they would form a legal group reference. Only the numerals '0' * through '9' are considered as potential components of the group * reference. If the second group matched the string <tt>"foo"</tt>, for