Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
global 접근자 속성은 g 플래그가 정규표현식에 사용되었는지 여부를 나타냅니다.
g 플래그가 사용된 경우 RegExp.prototype.global의 값은 true이고, 그렇지 않으면 false입니다. g 플래그는 정규식이 문자열에서 가능한 모든 일치 항목에 대해 테스트되어야 함을 나타냅니다. exec()를 호출할 때마다 lastIndex 속성이 업데이트되므로 다음 exec() 호출은 다음 문자에서 시작됩니다.
String.prototype.matchAll() 및 String.prototype.replaceAll()과 같은 일부 메서드는 매개변수가 정규식인 경우 전역(global)인지 여부를 확인합니다. 정규식의 @@match 및 @@replace 메서드(String.prototype.match() 및 String.prototype.replace()에 의해 호출됨)도 정규식이 전역일 때 다른 동작을 갖습니다.
global의 set 접근자는 undefined, 즉 정의되지 않았습니다. 이 속성은 직접 변경할 수 없습니다.
| ECMAScript® 2027 Language Specification # sec-get-regexp.prototype.global |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.