A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Symbol/matchAll below:

Symbol.matchAll - JavaScript | MDN

Symbol.matchAll

Baseline Widely available

Symbol.matchAll 정적 데이터 속성은 잘 알려진 심볼 @@matchAll을 나타냅니다. String.prototype.matchAll() 메서드는 문자열과 현재 객체의 일치 항목을 산출하는 반복자를 반환하는 메서드의 첫 번째 인수에서 이 심볼을 조회합니다.

더 많은 정보를 참고하시려면 RegExp.prototype[@@matchAll]()와 String.prototype.matchAll()를 참고하시기 바랍니다.

시도해 보기
const re = /[0-9]+/g;
const str = "2016-01-02|2019-03-07";
const result = re[Symbol.matchAll](str);

console.log(Array.from(result, (x) => x[0]));
// Expected output: Array ["2016", "01", "02", "2019", "03", "07"]
값

잘 알려진 심볼 @@matchAll.

쓰기 가능 불가능 열거 가능 불가능 설정 가능 불가능 예제 Symbol.matchAll 사용하기
const str = "2016-01-02|2019-03-07";

const numbers = {
  *[Symbol.matchAll](str) {
    for (const n of str.matchAll(/[0-9]+/g)) yield n[0];
  },
};

console.log(Array.from(str.matchAll(numbers)));
// ["2016", "01", "02", "2019", "03", "07"]
명세서 브라우저 호환성 같이 보기

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4