[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Guide/Regular_expressions/Assertions [Back]  [Original]

Assertions - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Assertions

(assertion) . , (look-ahead) (look-behind) .

In this article

: ? .

x(?=y) : x x y. , /Jack(?=Sprat)/ "Jack" "Sprat". /Jack(?=Sprat|Frost)/ "Jack" "Sprat" "Frost". , "Sprat" "Frost" .
x(?!y) : x x y. , /\d+(?!\.)/ , . /\d+(?!\.)/.exec('3.141') "141", "3" .
(?<=y)x : x x y. , /(?<=Jack)Sprat/ "Sprat" "Jack". /(?<=Jack|Tom)Sprat/ "Sprat" "Jack" "Tom". , "Jack" "Tom" .
(?<!y)x : x x y. , /(?<!-)\d+/ , . /(?<!-)\d+/.exec('3') "3". /(?<!-)\d+/.exec('-3') , .. .

Web Proxy Viewer  |  New URL  |  Original Page