Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


MatchResultjava.util.regex

Java 5.0

This
interface represents the results of
a regular expression matching operation performed by a
Matcher. Matcher implements
this interface directly, and you can use the methods defined here to
obtain the results of the most recent match performed by a
Matcher. You can also save those most recent match
results in a separate immutable MatchResult object
by calling the toMatchResult( ) method of the
Matcher.

The no-argument versions of the start( ) and
end( ) method return the index of the first
character that matched the pattern and the index of the last
character that matched plus one (the index of the first character
following the matched text), respectively. Some regular expressions
can match the empty string. If this occurs, end( )
returns the same value as start( ). The
no-argument version of group( ) returns the text
that matched the pattern.

If the matched Pattern includes capturing
subexpressions within parentheses, the other methods of this
interface provide details about the text that matched each of those
subexpressions. Pass a group number to start( ),
end( ), or group( ) to obtain
the start, end, or text that matched the specified group.
groupCount( ) returns the number of
subexpressions. Groups are numbered from 1, however, so legal group
numbers run from 1 to the value returned by groupCount(
). Groups are ordered from left-to-right within the regular
expression. When there are nested groups, their ordering is based on
the position of the opening left parenthesis that begins the group.
Group 0 represents the entire regular expression, so passing 0 to
start( ), end( ), or
group( ) is the same as calling the no-argument
version of the method.

public interface

MatchResult {
// Public Instance Methods
int

end ( );
int

end (int

group );
String

group ( );
String

group (int

group );
int

groupCount ( );
int

start ( );
int

start (int

group );
}


Implementations


Matcher

Returned By


java.util.Scanner.match( ),
Matcher.toMatchResult( )


    / 1191