Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

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

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

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

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

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

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

Availability


JavaScript 1.2; JScript 5.5; ECMAScript v3


Synopsis

regexp.lastIndex


Description


lastIndex is a read/write property of RegExp
objects. For regular expressions with the g
attribute set, it contains an integer that specifies the character
position immediately following the last match found by the
RegExp.exec( ) and RegExp.test(
) methods. These methods use this property as the starting
point for the next search they conduct. This allows you to call those
methods repeatedly, to loop through all matches in a string. Note
that lastIndex is not used by RegExp objects that
do not have the g attribute and do not represent
global patterns.

This property is read/write, so you can set it at any time to specify
where in the target string the next search should begin.
exec( ) and test( )
automatically reset lastIndex to 0 when they fail
to find a match (or another match). If you begin to search a new
string after a successful match of some other string, you have to
explicitly set this property to 0.


See Also


RegExp.exec( ), RegExp.test( )

/ 844