pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags

href="?u=http://developer.mozilla.org/static/client/inter-latin.9a3b1bc220d426ef.woff2" as="font" type="font/woff2" crossorigen="anonymous" fetchpriority="low" />

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

RegExp.prototype.flags

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020년 1월.

flags 접근자 속성은 현재 정규식 객체의 플래그를 나타냅니다.

시도해 보기

// Outputs RegExp flags in alphabetical order

console.log(/foo/gi.flags);
// Expected output: "gi"

console.log(/bar/muy.flags);
// Expected output: "muy"

설명

RegExp.prototype.flags는 문자열입니다. flags 속성의 플래그는 왼쪽에서 오른쪽으로 알파벳 순으로 정렬됩니다(예를 들어 "dgimsuy"). 실제로 다른 플래그 접근자(hasIndices, global, 등등)를 하나씩 호출하고 결과를 연결합니다.

내장된 모든 함수는 개별 플래그 접근자를 읽는 대신 flags 속성을 읽습니다.

flags의 set 접근자는 정의되지 않았습니다. 이 속성을 직접 변경할 수 없습니다.

예제

flags 사용하기

js
/foo/ig.flags; // "gi"
/bar/myu.flags; // "muy"

명세서

Specification
ECMAScript® 2027 Language Specification
# sec-get-regexp.prototype.flags

브라우저 호환성

같이 보기

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy