diff options
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/symbol/matchall/index.html')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/symbol/matchall/index.html | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/symbol/matchall/index.html b/files/fr/web/javascript/reference/global_objects/symbol/matchall/index.html new file mode 100644 index 0000000000..93b8428c10 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/symbol/matchall/index.html @@ -0,0 +1,67 @@ +--- +title: Symbol.matchAll +slug: Web/JavaScript/Reference/Objets_globaux/Symbol/matchAll +tags: + - JavaScript + - Propriété + - Reference + - Symbol +translation_of: Web/JavaScript/Reference/Global_Objects/Symbol/matchAll +--- +<div>{{JSRef}}</div> + +<p>Le symbole connu <code><strong>Symbol.matchAll</strong></code> renvoie un itérateur qui fournit l'ensemble des correspondances entre une expression rationnelle et une chaîne de caractères. Cette fonction est implicitement appelée par la méthode {{jsxref("String.prototype.matchAll()")}}.</p> + +<div>{{EmbedInteractiveExample("pages/js/symbol-matchall.html")}}</div> + +<p class="hidden">Le code source de cet exemple interactif est disponible dans un dépôt GitHub. Si vous souhaitez contribuer à ces exemples, n'hésitez pas à cloner <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> et à envoyer une <em>pull request</em> !</p> + +<h2 id="Description">Description</h2> + +<div> +<p>Ce symbole est utilisé par {{jsxref("String.prototype.matchAll()")}} et plus particulièrement par {{jsxref("RegExp.@@matchAll", "RegExp.prototype[@@matchAll]()")}}. Les deux lignes qui suivent renverront le même résultat :</p> + +<pre class="brush: js">'abc'.matchAll(/a/); + +/a/[Symbol.matchAll]('abc');</pre> + +<p>Cette méthode existe afin de personnaliser le comportement des correspondances pour les sous-classes de {{jsxref("RegExp")}}.</p> + +<p>{{js_property_attributes(0,0,0)}}</p> +</div> + +<h2 id="Exemples">Exemples</h2> + +<p>Voir les pages {{jsxref("String.prototype.matchAll()")}} et {{jsxref("RegExp.@@matchAll", "RegExp.prototype[@@matchAll]()")}} pour plus d'exemples.</p> + +<h2 id="Spécifications">Spécifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Spécification</th> + <th scope="col">État</th> + <th scope="col">Commentaires</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('ESDraft', '#sec-symbol.matchall', 'Symbol.matchAll')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> + +<div class="hidden">Le tableau de compatibilité de cette page a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à consulter <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> et à nous envoyer une <em>pull request</em>.</div> + +<p>{{Compat("javascript.builtins.Symbol.matchAll")}}</p> + +<h2 id="Voir_aussi">Voir aussi</h2> + +<ul> + <li>{{jsxref("String.prototype.matchAll()")}}</li> + <li>{{jsxref("RegExp.@@matchAll", "RegExp.prototype[@@matchAll]()")}}</li> +</ul> |
