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


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

URL: http://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags

a1-e57c-4bdf-a490-390a1aebf6dd/airgap.js" >

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

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月.

flagsRegExp インスタンスのプロパティで、現在の正規表現オブジェクトのフラグから成る文字列を返します。

試してみましょう

// 正規表現フラグをアルファベット順に出力

console.log(/foo/gi.flags);
// 予想される結果: "gi"

console.log(/^bar/muy.flags);
// 予想される結果: "muy"

解説

RegExp.prototype.flags には値として文字列があります。flags プロパティのフラグはアルファベット順で並べ替えられます(左から右に、例えば "dgimsuvy")。 実際には、他のフラグアクセサー(hasIndicesglobalなど)を 1 つずつ呼び出し、結果を連結します。

すべての組み込み関数は、個々のフラグアクセサーを読み込む代わりに flags プロパティを読み込みます。

flags の設定アクセサーは undefined です。このプロパティを直接変更することはできません。

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