Movatterモバイル変換


[0]ホーム

URL:


  1. 개발자를 위한 웹 기술
  2. JavaScript
  3. JavaScript 참고서
  4. 표준 내장 객체
  5. RegExp
  6. RegExp.prototype.ignoreCase

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

View in EnglishAlways switch to English

RegExp.prototype.ignoreCase

Baseline Widely available

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

ignoreCase 접근자 속성은i 플래그가 정규 표현식에 사용되었는지 여부를 가리킵니다.

시도해 보기

const regex1 = new RegExp("foo");const regex2 = new RegExp("foo", "i");console.log(regex1.test("Football"));// Expected output: falseconsole.log(regex2.ignoreCase);// Expected output: trueconsole.log(regex2.test("Football"));// Expected output: true

설명

RegExp.prototype.ignoreCasei 플래그가 사용되었으먼true값을 가집니다. 그렇지 않으면false 값을 가집니다.i 플래그는 문자열 매칭에서 대소문자를 구분하지 않음을 가리킵니다.

정규식에unicode 플래그가 있는 경우 대/소문자 케이스 매핑은CaseFolding.txt에 명시된 대로 수행됩니다. 그렇지 않으면 대/소문자 매핑은Unicode Default Case Conversion을 사용합니다. 이 알고리즘은String.prototype.toUpperCase()String.prototype.toLowerCase()에서 사용되는 알고리즘과 동일합니다.

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

예제

ignoreCase 사용하기

js
const regex = /foo/i;console.log(regex.ignoreCase); // true

명세서

Specification
ECMAScript® 2026 Language Specification
# sec-get-regexp.prototype.ignorecase

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp