RegExp object attributes of js Regular Expressions: lastIndex, lastMatch, lastParen, lastContext,

Source: Internet
Author: User

1. The lastIndex attribute returns the last index location of the matched content, that is, the starting position of the next match. Note that the string index starts from 0.
Code:
<Html> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
2. lastMatch ($ &) attribute, read-only attribute. If no matching information exists, the value of this attribute is a null string.
<Html> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
3. Read-only static attribute of the lastParen attribute. This attribute returns the value of the last child match obtained in the last match detection. If no child match exists, an empty string is returned.
<Html> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
4. The leftContext attribute returns the character information on the left side of the matching content. The initial value of this attribute is a Null String. If the value matches this attribute
<Html> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
5. The rightContext attribute returns the character information to the right of the matching content. The initial value of the read-only static attribute is a Null String. If there is a match, the information to the right of the matching content is returned.
<Html> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.