<sectionid="description"> Vio cómo puede usar los <code>character sets</code> para especificar un grupo de caracteres para hacer coincidir, pero eso es mucho para escribir cuando necesita hacer coincidir una gran variedad de caracteres (por ejemplo, todas las letras del alfabeto). Afortunadamente, hay una característica incorporada que hace que esto sea breve y simple. Dentro de un <code>character set</code> , puede definir un rango de caracteres para hacer coincidir usando un carácter de <code>hyphen</code> : <code>-</code> . Por ejemplo, para que coincida con las letras minúsculas <code>a</code> medio <code>e</code> que usaría <code>[ae]</code> . <blockquote> vamos catStr = "gato"; <br> dejar batStr = "bat"; <br> dejar matStr = "mat"; <br> vamos bgRegex = / [ae] en /; <br> catStr.match (bgRegex); // Devoluciones ["cat"] <br> batStr.match (bgRegex); // Devoluciones ["bat"] <br> matStr.match (bgRegex); // Devoluciones nulas </blockquote></section>
<sectionid="instructions"> Coinciden con todas las letras en la cadena <code>quoteSample</code> . <strong>Nota</strong><br> Asegúrese de hacer coincidir las <strong>letras</strong> mayúsculas y minúsculas <strong><strong>.</strong></strong></section>