From 1dab0abbd00a485a6160baada0107b677d3feb34 Mon Sep 17 00:00:00 2001 From: CamperBot Date: Fri, 26 Mar 2021 20:12:17 +0530 Subject: [PATCH] chore(i8n,curriculum): processed translations (#41595) Co-authored-by: Crowdin Bot --- ...or-property-when-changing-the-prototype.md | 20 ++++++----- .../find-more-than-the-first-match.md | 26 ++++++++------- .../find-one-or-more-criminals-in-a-hunt.md | 30 ++++++++--------- .../ignore-case-while-matching.md | 30 ++++++++--------- ...ral-string-with-different-possibilities.md | 26 +++++++-------- .../match-all-letters-and-numbers.md | 32 +++++++++--------- .../match-all-non-numbers.md | 24 +++++++------- .../regular-expressions/match-all-numbers.md | 24 +++++++------- ...atch-everything-but-letters-and-numbers.md | 26 ++++++++------- .../match-letters-of-the-alphabet.md | 26 ++++++++------- ...e-character-with-multiple-possibilities.md | 33 ++++++++++--------- .../match-single-characters-not-specified.md | 16 ++++----- .../regular-expressions/match-whitespace.md | 20 +++++------ .../remove-whitespace-from-start-and-end.md | 14 ++++---- .../specify-exact-number-of-matches.md | 30 +++++++++-------- 15 files changed, 195 insertions(+), 182 deletions(-) diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.md index 76874fedec..c51420bfd1 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.md @@ -1,6 +1,6 @@ --- id: 587d7daf367417b2b2512b80 -title: Remember to Set the Constructor Property when Changing the Prototype +title: Recuerda establecer la propiedad "constructor" al cambiar el prototipo challengeType: 1 forumTopicId: 301323 dashedName: remember-to-set-the-constructor-property-when-changing-the-prototype @@ -8,19 +8,21 @@ dashedName: remember-to-set-the-constructor-property-when-changing-the-prototype # --description-- -There is one crucial side effect of manually setting the prototype to a new object. It erases the `constructor` property! This property can be used to check which constructor function created the instance, but since the property has been overwritten, it now gives false results: +Hay un efecto secundario crucial de ajustar manualmente el prototipo a un nuevo objeto. ¡Elimina la propiedad `constructor`! Esta propiedad puede ser usada para verificar cuál función de constructor creó la instancia. Sin embargo, dado que la propiedad ha sido sobrescrita, ahora devuelve resultados falsos: ```js -duck.constructor === Bird; // false -- Oops -duck.constructor === Object; // true, all objects inherit from Object.prototype -duck instanceof Bird; // true, still works +duck.constructor === Bird; +duck.constructor === Object; +duck instanceof Bird; ``` -To fix this, whenever a prototype is manually set to a new object, remember to define the `constructor` property: +En orden, estas expresiones se evaluarían como `false`, `true` y `true`. + +Para solucionar esto, cada vez que un prototipo se establece de forma manual a un nuevo objeto, recuerda definir la propiedad `constructor`: ```js Bird.prototype = { - constructor: Bird, // define the constructor property + constructor: Bird, numLegs: 2, eat: function() { console.log("nom nom nom"); @@ -33,11 +35,11 @@ Bird.prototype = { # --instructions-- -Define the `constructor` property on the `Dog` `prototype`. +Define la propiedad `constructor` en el `Dog` `prototype`. # --hints-- -`Dog.prototype` should set the `constructor` property. +`Dog.prototype` debe establecer la propiedad `constructor`. ```js assert(Dog.prototype.constructor === Dog); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.md index cb76eff45d..9940d3362b 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.md @@ -1,6 +1,6 @@ --- id: 587d7db4367417b2b2512b93 -title: Find More Than the First Match +title: Encuentra más que la primera coincidencia challengeType: 1 forumTopicId: 301342 dashedName: find-more-than-the-first-match @@ -8,45 +8,47 @@ dashedName: find-more-than-the-first-match # --description-- -So far, you have only been able to extract or search a pattern once. +Hasta ahora, sólo has podido extraer o buscar un patrón una vez. ```js let testStr = "Repeat, Repeat, Repeat"; let ourRegex = /Repeat/; testStr.match(ourRegex); -// Returns ["Repeat"] ``` -To search or extract a pattern more than once, you can use the `g` flag. +Aquí `match` devolverá `["Repeat"]`. + +Para buscar o extraer un patrón más de una vez, puedes utilizar la bandera `g`. ```js let repeatRegex = /Repeat/g; testStr.match(repeatRegex); -// Returns ["Repeat", "Repeat", "Repeat"] ``` +Y aquí `match` devuelve el valor `["Repeat", "Repeat", "Repeat"]` + # --instructions-- -Using the regex `starRegex`, find and extract both `"Twinkle"` words from the string `twinkleStar`. +Utilizando la expresión regular `starRegex`, encuentra y extrae ambas palabras `Twinkle` de la cadena `twinkleStar`. -**Note** -You can have multiple flags on your regex like `/search/gi` +**Nota** +En tu expresión regular puedes utilizar múltiples banderas, como `/search/gi` # --hints-- -Your regex `starRegex` should use the global flag `g` +La expresión regular `starRegex` debe utilizar la bandera global `g` ```js assert(starRegex.flags.match(/g/).length == 1); ``` -Your regex `starRegex` should use the case insensitive flag `i` +Tu expresión regular `starRegex` debe utilizar la bandera que no distingue entre mayúsculas y minúsculas `i` ```js assert(starRegex.flags.match(/i/).length == 1); ``` -Your match should match both occurrences of the word `"Twinkle"` +Tu coincidencia (match) debe coincidir con ambas apariciones de la palabra `Twinkle` ```js assert( @@ -58,7 +60,7 @@ assert( ); ``` -Your match `result` should have two elements in it. +Tu coincidencia `result` debe tener dos elementos en él. ```js assert(result.length == 2); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.md index e94ab1943c..077a8c5769 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.md @@ -1,6 +1,6 @@ --- id: 587d7db7367417b2b2512b9c -title: Find One or More Criminals in a Hunt +title: Encuentra uno o más criminales en una cacería challengeType: 1 forumTopicId: 301343 dashedName: find-one-or-more-criminals-in-a-hunt @@ -8,11 +8,11 @@ dashedName: find-one-or-more-criminals-in-a-hunt # --description-- -Time to pause and test your new regex writing skills. A group of criminals escaped from jail and ran away, but you don't know how many. However, you do know that they stay close together when they are around other people. You are responsible for finding all of the criminals at once. +Es hora de hacer una pausa y probar tus nuevas habilidades para escribir expresiones regulares. Un grupo de criminales se han escapado de la cárcel, pero no sabes cuántos. Sin embargo, sabes que permanecen unidos cuando están alrededor de otras personas. Eres responsable de encontrar a todos los criminales a la vez. -Here's an example to review how to do this: +Este es un ejemplo para revisar cómo hacer esto: -The regex `/z+/` matches the letter `z` when it appears one or more times in a row. It would find matches in all of the following strings: +La expresión regular `/z+/` coincide con la letra `z` cuando aparece una o más veces seguidas. Encontrará coincidencias en las siguientes cadenas: ```js "z" @@ -22,7 +22,7 @@ The regex `/z+/` matches the letter `z` when it appears one or more times in a r "abczzzzzzzzzzzzzzzzzzzzzabc" ``` -But it does not find matches in the following strings since there are no letter `z` characters: +Pero no encuentra coincidencias en las siguientes cadenas, ya que no hay letras `z`: ```js "" @@ -32,32 +32,32 @@ But it does not find matches in the following strings since there are no letter # --instructions-- -Write a greedy regex that finds one or more criminals within a group of other people. A criminal is represented by the capital letter `C`. +Escribe una expresión regular codiciosa que encuentre uno o más criminales dentro de un grupo de personas. Un criminal está representado por la letra mayúscula `C`. # --hints-- -Your regex should match one criminal (`C`) in `"C"` +Tu expresión regular debe coincidir con un criminal (`C`) en la cadena `C` ```js assert('C'.match(reCriminals) && 'C'.match(reCriminals)[0] == 'C'); ``` -Your regex should match two criminals (`CC`) in `"CC"` +Tu expresión regular debe coincidir con dos criminales (`CC`) en la cadena `CC` ```js assert('CC'.match(reCriminals) && 'CC'.match(reCriminals)[0] == 'CC'); ``` -Your regex should match three criminals (`CCC`) in `"P1P5P4CCCP2P6P3"` +Tu expresión regular debe coincidir con tres criminales (`CCC`) en la cadena `P1P5P4CCCcP2P6P3`. ```js assert( - 'P1P5P4CCCP2P6P3'.match(reCriminals) && - 'P1P5P4CCCP2P6P3'.match(reCriminals)[0] == 'CCC' + 'P1P5P4CCCcP2P6P3'.match(reCriminals) && + 'P1P5P4CCCcP2P6P3'.match(reCriminals)[0] == 'CCC' ); ``` -Your regex should match five criminals (`CCCCC`) in `"P6P2P7P4P5CCCCCP3P1"` +Tu expresión regular debe coincidir con cinco criminales (`CCCCC`) en la cadena `P6P2P7P4P5CCCCCP3P1` ```js assert( @@ -66,19 +66,19 @@ assert( ); ``` -Your regex should not match any criminals in `""` +Tu expresión regular no debe coincidir con ningún criminal en la cadena vacía `""` ```js assert(!reCriminals.test('')); ``` -Your regex should not match any criminals in `"P1P2P3"` +Tu regex no debe coincidir con ningún criminal en la cadena `P1P2P3` ```js assert(!reCriminals.test('P1P2P3')); ``` -Your regex should match fifty criminals (`CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC`) in `"P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3"`. +Tu expresión regular debe coincidir con cincuenta criminales (`CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC`) en la cadena `P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3`. ```js assert( diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.md index 8ea7f4218e..0619c5e466 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.md @@ -1,6 +1,6 @@ --- id: 587d7db4367417b2b2512b91 -title: Ignore Case While Matching +title: Ignora la capitalización al coincidir challengeType: 1 forumTopicId: 301344 dashedName: ignore-case-while-matching @@ -8,73 +8,73 @@ dashedName: ignore-case-while-matching # --description-- -Up until now, you've looked at regexes to do literal matches of strings. But sometimes, you might want to also match case differences. +Hasta ahora, has visto expresiones regulares para hacer coincidir cadenas literales. Pero a veces, tal vez quieras hacer coincidir las diferencias de capitalización. -Case (or sometimes letter case) is the difference between uppercase letters and lowercase letters. Examples of uppercase are `"A"`, `"B"`, and `"C"`. Examples of lowercase are `"a"`, `"b"`, and `"c"`. +La capitalización (o también llamada capitalización de letra) es la diferencia entre mayúsculas y minúsculas. Ejemplos de mayúsculas son `A`, `B` y `C`. Ejemplos de minúsculas son `a`, `b` y `c`. -You can match both cases using what is called a flag. There are other flags but here you'll focus on the flag that ignores case - the `i` flag. You can use it by appending it to the regex. An example of using this flag is `/ignorecase/i`. This regex can match the strings `"ignorecase"`, `"igNoreCase"`, and `"IgnoreCase"`. +Puedes coincidir ambos casos utilizando algo llamado bandera. Existen otras banderas, pero aquí te centrarás en la que ignora la capitalización de las letras, la bandera `i`. Puedes usarla añadiéndola a la expresión regular. Un ejemplo de uso de esta bandera es `/ignorecase/i`. Esta expresión regular puede coincidir con las cadenas `ignorecase`, `igNoreCase` e `IgnoreCase`. # --instructions-- -Write a regex `fccRegex` to match `"freeCodeCamp"`, no matter its case. Your regex should not match any abbreviations or variations with spaces. +Escribe una expresión regular `fccRegex` para que coincida con `freeCodeCamp` sin importar su capitalización. Tu expresión regular no debe coincidir con ninguna abreviatura o variación con espacios. # --hints-- -Your regex should match `freeCodeCamp` +Tu expresión regular debe coincidir con la cadena `freeCodeCamp` ```js assert(fccRegex.test('freeCodeCamp')); ``` -Your regex should match `FreeCodeCamp` +Tu expresión regular debe coincidir con la cadena `FreeCodeCamp` ```js assert(fccRegex.test('FreeCodeCamp')); ``` -Your regex should match `FreecodeCamp` +Tu expresión regular debe coincidir con la cadena `FreecodeCamp` ```js assert(fccRegex.test('FreecodeCamp')); ``` -Your regex should match `FreeCodecamp` +Tu expresión regular debe coincidir con la cadena `FreeCodecamp` ```js assert(fccRegex.test('FreeCodecamp')); ``` -Your regex should not match `Free Code Camp` +Tu expresión regular no debe coincidir con la cadena `Free Code Camp` ```js assert(!fccRegex.test('Free Code Camp')); ``` -Your regex should match `FreeCOdeCamp` +Tu expresión regular debe coincidir con la cadena `FreeCOdeCamp` ```js assert(fccRegex.test('FreeCOdeCamp')); ``` -Your regex should not match `FCC` +Tu expresión regular no debe coincidir con la cadena `FCC` ```js assert(!fccRegex.test('FCC')); ``` -Your regex should match `FrEeCoDeCamp` +Tu expresión regular debe coincidir con la cadena `FrEeCoDeCamp` ```js assert(fccRegex.test('FrEeCoDeCamp')); ``` -Your regex should match `FrEeCodECamp` +Tu expresión regular debe coincidir con la cadena `FrEeCodECamp` ```js assert(fccRegex.test('FrEeCodECamp')); ``` -Your regex should match `FReeCodeCAmp` +Tu expresión regular debe coincidir con la cadena `FReeCodeCAmp` ```js assert(fccRegex.test('FReeCodeCAmp')); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.md index c98f45b851..26c95332a6 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.md @@ -1,6 +1,6 @@ --- id: 587d7db4367417b2b2512b90 -title: Match a Literal String with Different Possibilities +title: Coincide una cadena literal con diferentes posibilidades challengeType: 1 forumTopicId: 301345 dashedName: match-a-literal-string-with-different-possibilities @@ -8,57 +8,57 @@ dashedName: match-a-literal-string-with-different-possibilities # --description-- -Using regexes like `/coding/`, you can look for the pattern `"coding"` in another string. +Al utilizar expresiones regulares como `/coding/`, puedes buscar el patrón `coding` en otra cadena. -This is powerful to search single strings, but it's limited to only one pattern. You can search for multiple patterns using the `alternation` or `OR` operator: `|`. +Esto es muy potente al buscar cadenas individuales, pero está limitado a un solo patrón. Puedes buscar múltiples patrones usando el operador `alternation` o `OR`: `|`. -This operator matches patterns either before or after it. For example, if you wanted to match `"yes"` or `"no"`, the regex you want is `/yes|no/`. +Este operador coincide con los patrones antes o después de él. Por ejemplo, si deseas coincidir con las cadenas `yes` o `no`, la expresión regular que quieres es `/yes|no/`. -You can also search for more than just two patterns. You can do this by adding more patterns with more `OR` operators separating them, like `/yes|no|maybe/`. +También puedes buscar más de dos patrones. Puedes hacer esto añadiendo más patrones con más operadores `OR` separándolos, como `/yes|no|maybe/`. # --instructions-- -Complete the regex `petRegex` to match the pets `"dog"`, `"cat"`, `"bird"`, or `"fish"`. +Completa la expresión regular `petRegex` para que coincida con las mascotas `dog`, `cat`, `bird`, o `fish`. # --hints-- -Your regex `petRegex` should return `true` for the string `"John has a pet dog."` +Tu expresión regular `petRegex` debe devolver `true` para la cadena `John has a pet dog.` ```js assert(petRegex.test('John has a pet dog.')); ``` -Your regex `petRegex` should return `false` for the string `"Emma has a pet rock."` +Tu expresión regular `petRegex` debe devolver `false` para la cadena `Emma has a pet rock.` ```js assert(!petRegex.test('Emma has a pet rock.')); ``` -Your regex `petRegex` should return `true` for the string `"Emma has a pet bird."` +Tu expresión regular `petRegex` debe devolver `true` para la cadena `Emma has a pet bird.` ```js assert(petRegex.test('Emma has a pet bird.')); ``` -Your regex `petRegex` should return `true` for the string `"Liz has a pet cat."` +Tu expresión regular `petRegex` debe devolver `true` para la cadena `Liz has a pet cat.` ```js assert(petRegex.test('Liz has a pet cat.')); ``` -Your regex `petRegex` should return `false` for the string `"Kara has a pet dolphin."` +Tu expresión regular `petRegex` debe devolver `false` para la cadena `Kara has a pet dolphin.` ```js assert(!petRegex.test('Kara has a pet dolphin.')); ``` -Your regex `petRegex` should return `true` for the string `"Alice has a pet fish."` +Tu expresión regular `petRegex` debe devolver `true` para la cadena `Alice has a pet fish.` ```js assert(petRegex.test('Alice has a pet fish.')); ``` -Your regex `petRegex` should return `false` for the string `"Jimmy has a pet computer."` +Tu expresión regular `petRegex` debe devolver `false` para la cadena `Jimmy has a pet computer.` ```js assert(!petRegex.test('Jimmy has a pet computer.')); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.md index 70cb70395a..bdbc8cea25 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.md @@ -1,6 +1,6 @@ --- id: 587d7db7367417b2b2512b9f -title: Match All Letters and Numbers +title: Coincide todas las letras y números challengeType: 1 forumTopicId: 301346 dashedName: match-all-letters-and-numbers @@ -8,42 +8,44 @@ dashedName: match-all-letters-and-numbers # --description-- -Using character classes, you were able to search for all letters of the alphabet with `[a-z]`. This kind of character class is common enough that there is a shortcut for it, although it includes a few extra characters as well. +Usando clases de caracteres, pudiste buscar todas las letras del alfabeto con `[a-z]`. Este tipo de clase de caracteres es tan común que existe un atajo para él, aunque también incluye algunos caracteres adicionales. -The closest character class in JavaScript to match the alphabet is `\w`. This shortcut is equal to `[A-Za-z0-9_]`. This character class matches upper and lowercase letters plus numbers. Note, this character class also includes the underscore character (`_`). +La clase de caracteres más cercana en JavaScript para coincidir con el alfabeto es `\w`. Este atajo equivale a `[A-Za-z0-9_]`. Esta clase de caracteres coincide con letras mayúsculas y minúsculas más números. Ten en cuenta que esta clase de caracteres también incluye el carácter de guión bajo (`_`). ```js let longHand = /[A-Za-z0-9_]+/; let shortHand = /\w+/; let numbers = "42"; let varNames = "important_var"; -longHand.test(numbers); // Returns true -shortHand.test(numbers); // Returns true -longHand.test(varNames); // Returns true -shortHand.test(varNames); // Returns true +longHand.test(numbers); +shortHand.test(numbers); +longHand.test(varNames); +shortHand.test(varNames); ``` -These shortcut character classes are also known as shorthand character classes. +Las cuatro llamadas a `test` devolverán `true`. + +Estos atajos de clases de caracteres también son conocidos como clases de caracteres abreviados. # --instructions-- -Use the shorthand character class `\w` to count the number of alphanumeric characters in various quotes and strings. +Utiliza la clase de caracteres abreviada `\w` para contar el número de caracteres alfanuméricos en varias citas y cadenas. # --hints-- -Your regex should use the global flag. +Tu expresión regular debe usar la bandera global. ```js assert(alphabetRegexV2.global); ``` -Your regex should use the shorthand character `\w` to match all characters which are alphanumeric. +Tu expresión regular debe usar el carácter abreviado `\w` para coincidir con todos los caracteres alfanuméricos. ```js assert(/\\w/.test(alphabetRegexV2.source)); ``` -Your regex should find 31 alphanumeric characters in `"The five boxing wizards jump quickly."` +Tu expresión regular debe encontrar 31 caracteres alfanuméricos en la cadena `The five boxing wizards jump quickly.` ```js assert( @@ -51,7 +53,7 @@ assert( ); ``` -Your regex should find 32 alphanumeric characters in `"Pack my box with five dozen liquor jugs."` +Tu expresión regular debe encontrar 32 caracteres alfanuméricos en la cadena `Pack my box with five dozen liquor jugs.` ```js assert( @@ -60,7 +62,7 @@ assert( ); ``` -Your regex should find 30 alphanumeric characters in `"How vexingly quick daft zebras jump!"` +Tu expresión regular debe encontrar 30 caracteres alfanuméricos en la cadena `How vexingly quick daft zebras jump!` ```js assert( @@ -68,7 +70,7 @@ assert( ); ``` -Your regex should find 36 alphanumeric characters in `"123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ."` +Tu expresión regular debe encontrar 36 caracteres alfanuméricos en la cadena `123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.` ```js assert( diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.md index 2290a226d9..2c6d1f88e1 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.md @@ -1,6 +1,6 @@ --- id: 587d7db8367417b2b2512ba1 -title: Match All Non-Numbers +title: Coincide con todos los caracteres no numéricos challengeType: 1 forumTopicId: 301347 dashedName: match-all-non-numbers @@ -8,59 +8,59 @@ dashedName: match-all-non-numbers # --description-- -The last challenge showed how to search for digits using the shortcut `\d` with a lowercase `d`. You can also search for non-digits using a similar shortcut that uses an uppercase `D` instead. +El último desafío mostró cómo buscar dígitos usando el atajo `\d` con una `d` minúscula. También puedes buscar caracteres que no sean dígitos usando un atajo similar que utilice una `D` mayúscula en su lugar. -The shortcut to look for non-digit characters is `\D`. This is equal to the character class `[^0-9]`, which looks for a single character that is not a number between zero and nine. +El atajo para buscar caracteres que no sean dígitos es `\D`. Esto es igual a la clase de caracteres `[^0-9]`, el cual busca un único carácter que no sea un número entre cero y nueve. # --instructions-- -Use the shorthand character class for non-digits `\D` to count how many non-digits are in movie titles. +Usa la clase de caracteres abreviada `\D` para contar cuántos caracteres que no sean dígitos hay en los títulos de las películas. # --hints-- -Your regex should use the shortcut character to match non-digit characters +Tu expresión regular debe usar el carácter de atajo que coincida con caracteres que no sean dígitos ```js assert(/\\D/.test(noNumRegex.source)); ``` -Your regex should use the global flag. +Tu expresión regular debe usar la bandera global. ```js assert(noNumRegex.global); ``` -Your regex should find no non-digits in `"9"`. +Tu expresión regular no debe encontrar caracteres que no sean dígitos en la cadena `9`. ```js assert('9'.match(noNumRegex) == null); ``` -Your regex should find 6 non-digits in `"Catch 22"`. +Tu expresión regular debe encontrar 6 caracteres que no sean dígitos en la cadena `Catch 22`. ```js assert('Catch 22'.match(noNumRegex).length == 6); ``` -Your regex should find 11 non-digits in `"101 Dalmatians"`. +Tu expresión regular debe encontrar 11 caracteres que no sean dígitos en la cadena `101 Dalmatians`. ```js assert('101 Dalmatians'.match(noNumRegex).length == 11); ``` -Your regex should find 15 non-digits in `"One, Two, Three"`. +Tu expresión regular debe encontrar 15 caracteres que no sean dígitos en la cadena `One, Two, Three`. ```js assert('One, Two, Three'.match(noNumRegex).length == 15); ``` -Your regex should find 12 non-digits in `"21 Jump Street"`. +Tu expresión regular debe encontrar 12 caracteres que no sean dígitos en la cadena `21 Jump Street`. ```js assert('21 Jump Street'.match(noNumRegex).length == 12); ``` -Your regex should find 17 non-digits in `"2001: A Space Odyssey"`. +Tu expresión regular debe encontrar 17 caracteres que no sean dígitos en la cadena `2001: A Space Odyssey`. ```js assert('2001: A Space Odyssey'.match(noNumRegex).length == 17); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.md index 86c84f015a..e86ac430f4 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.md @@ -1,6 +1,6 @@ --- id: 5d712346c441eddfaeb5bdef -title: Match All Numbers +title: Coincide con todos los números challengeType: 1 forumTopicId: 18181 dashedName: match-all-numbers @@ -8,59 +8,59 @@ dashedName: match-all-numbers # --description-- -You've learned shortcuts for common string patterns like alphanumerics. Another common pattern is looking for just digits or numbers. +Has aprendido atajos para patrones de cadenas comunes como los alfanuméricos. Otro patrón común es buscar solo dígitos o números. -The shortcut to look for digit characters is `\d`, with a lowercase `d`. This is equal to the character class `[0-9]`, which looks for a single character of any number between zero and nine. +El atajo para buscar caracteres de dígitos es `\d`, con una `d` minúscula. Esto es igual a la clase de caracteres `[0-9]`, la cual busca un solo carácter de cualquier número entre cero y nueve. # --instructions-- -Use the shorthand character class `\d` to count how many digits are in movie titles. Written out numbers ("six" instead of 6) do not count. +Usa la clase de caracteres abreviada `\d` para contar cuántos dígitos hay en los títulos de las películas. Los números escritos ("seis" en lugar de 6) no cuentan. # --hints-- -Your regex should use the shortcut character to match digit characters +Tu expresión regular debe usar el carácter de atajo que coincida con caracteres de dígitos ```js assert(/\\d/.test(numRegex.source)); ``` -Your regex should use the global flag. +Tu expresión regular debe usar la bandera global. ```js assert(numRegex.global); ``` -Your regex should find 1 digit in `"9"`. +Tu expresión regular debe encontrar 1 dígito en la cadena `9`. ```js assert('9'.match(numRegex).length == 1); ``` -Your regex should find 2 digits in `"Catch 22"`. +Tu expresión regular debe encontrar 2 dígitos en la cadena `Catch 22`. ```js assert('Catch 22'.match(numRegex).length == 2); ``` -Your regex should find 3 digits in `"101 Dalmatians"`. +Tu expresión regular debe encontrar 3 dígitos en la cadena `101 Dalmatians`. ```js assert('101 Dalmatians'.match(numRegex).length == 3); ``` -Your regex should find no digits in `"One, Two, Three"`. +Tu expresión regular no debe encontrar dígitos en la cadena `One, Two, Three`. ```js assert('One, Two, Three'.match(numRegex) == null); ``` -Your regex should find 2 digits in `"21 Jump Street"`. +Tu expresión regular debe encontrar 2 dígitos en la cadena `21 Jump Street`. ```js assert('21 Jump Street'.match(numRegex).length == 2); ``` -Your regex should find 4 digits in `"2001: A Space Odyssey"`. +Tu expresión regular debe encontrar 4 dígitos en la cadena `2001: A Space Odyssey`. ```js assert('2001: A Space Odyssey'.match(numRegex).length == 4); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.md index 541817a663..98ec5ff678 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.md @@ -1,6 +1,6 @@ --- id: 587d7db8367417b2b2512ba0 -title: Match Everything But Letters and Numbers +title: Haz coincidir todo menos letras y números challengeType: 1 forumTopicId: 301353 dashedName: match-everything-but-letters-and-numbers @@ -8,31 +8,33 @@ dashedName: match-everything-but-letters-and-numbers # --description-- -You've learned that you can use a shortcut to match alphanumerics `[A-Za-z0-9_]` using `\w`. A natural pattern you might want to search for is the opposite of alphanumerics. +Has aprendido que puedes usar un atajo para emparejar alfanuméricos `[A-Za-z0-9_]` usando `\w`. Un patrón natural que tal vez quieras buscar es lo contrario a la alfanumérica. -You can search for the opposite of the `\w` with `\W`. Note, the opposite pattern uses a capital letter. This shortcut is the same as `[^A-Za-z0-9_]`. +Puedes buscar lo contrario de `\w` con `\W`. Ten en cuenta, el patrón contrario usa letra mayúscula. Este atajo es lo mismo que `[^A-Za-z0-9_]`. ```js let shortHand = /\W/; let numbers = "42%"; let sentence = "Coding!"; -numbers.match(shortHand); // Returns ["%"] -sentence.match(shortHand); // Returns ["!"] +numbers.match(shortHand); +sentence.match(shortHand); ``` +El primer `match` devuelve el valor `["%"]` y el segundo devuelve `["!"]`. + # --instructions-- -Use the shorthand character class `\W` to count the number of non-alphanumeric characters in various quotes and strings. +Usa la clase de caracteres abreviados `\W` para contar el número de caracteres no alfanuméricos en varias comillas y cadenas. # --hints-- -Your regex should use the global flag. +Tu expresión regular debe usar la bandera global. ```js assert(nonAlphabetRegex.global); ``` -Your regex should find 6 non-alphanumeric characters in `"The five boxing wizards jump quickly."`. +Tu expresión regular debe encontrar 6 caracteres no alfanuméricos en la cadena `The five boxing wizards jump quickly.`. ```js assert( @@ -40,13 +42,13 @@ assert( ); ``` -Your regex should use the shorthand character to match characters which are non-alphanumeric. +Tu expresión regular debe utilizar el carácter abreviado para coincidir con los caracteres no alfanuméricos. ```js assert(/\\W/.test(nonAlphabetRegex.source)); ``` -Your regex should find 8 non-alphanumeric characters in `"Pack my box with five dozen liquor jugs."` +Tu expresión regular debe encontrar 8 caracteres no alfanuméricos en la cadena `Pack my box with five dozen liquor jugs.` ```js assert( @@ -54,7 +56,7 @@ assert( ); ``` -Your regex should find 6 non-alphanumeric characters in `"How vexingly quick daft zebras jump!"` +Tu expresión regular debe encontrar 6 caracteres no alfanuméricos en la cadena `How vexingly quick daft zebras jump!` ```js assert( @@ -62,7 +64,7 @@ assert( ); ``` -Your regex should find 12 non-alphanumeric characters in `"123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ."` +Tu expresión regular debe encontrar 12 caracteres no alfanuméricos en la cadena `123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.` ```js assert( diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.md index 7b48c2b89d..ef34ce0bcd 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.md @@ -1,6 +1,6 @@ --- id: 587d7db5367417b2b2512b96 -title: Match Letters of the Alphabet +title: Haz coincidir las letras del alfabeto challengeType: 1 forumTopicId: 301354 dashedName: match-letters-of-the-alphabet @@ -8,43 +8,45 @@ dashedName: match-letters-of-the-alphabet # --description-- -You saw how you can use character sets to specify a group of characters to match, but that's a lot of typing when you need to match a large range of characters (for example, every letter in the alphabet). Fortunately, there is a built-in feature that makes this short and simple. +Has visto cómo puedes usar los conjuntos de caracteres para especificar un grupo de caracteres a coincidir, pero eso requiere escribir mucho cuando necesitas coincidir con un amplio rango de caracteres (por ejemplo, cada letra en el alfabeto). Afortunadamente, hay una funcionalidad incorporada que hace esto corto y sencillo. -Inside a character set, you can define a range of characters to match using a hyphen character: `-`. +Dentro de un conjunto de caracteres, puedes definir un rango de caracteres a coincidir usando un carácter de guion: `-`. -For example, to match lowercase letters `a` through `e` you would use `[a-e]`. +Por ejemplo, para hacer coincidir las letras minúsculas desde la `a` a la `e` usarías `[a-e]`. ```js let catStr = "cat"; let batStr = "bat"; let matStr = "mat"; let bgRegex = /[a-e]at/; -catStr.match(bgRegex); // Returns ["cat"] -batStr.match(bgRegex); // Returns ["bat"] -matStr.match(bgRegex); // Returns null +catStr.match(bgRegex); +batStr.match(bgRegex); +matStr.match(bgRegex); ``` +En orden, las tres llamadas a `match` devolverán los valores `["cat"]`, `["bat"]` y `null`. + # --instructions-- -Match all the letters in the string `quoteSample`. +Haz coincidir todas las letras en la cadena `quoteSample`. -**Note**: Be sure to match both uppercase and lowercase letters. +**Nota:** Asegúrate de hacer coincidir tanto las letras mayúsculas como minúsculas. # --hints-- -Your regex `alphabetRegex` should match 35 items. +Tu expresión regular `alphabetRegex` debe coincidir con 35 elementos. ```js assert(result.length == 35); ``` -Your regex `alphabetRegex` should use the global flag. +Tu expresión regular `alphabetRegex` debe utilizar la bandera global. ```js assert(alphabetRegex.flags.match(/g/).length == 1); ``` -Your regex `alphabetRegex` should use the case insensitive flag. +Tu expresión regular `alphabetRegex` debe utilizar la bandera que no distingue entre mayúsculas y minúsculas. ```js assert(alphabetRegex.flags.match(/i/).length == 1); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.md index 097ded3a04..71f57e5c4f 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.md @@ -1,6 +1,6 @@ --- id: 587d7db5367417b2b2512b95 -title: Match Single Character with Multiple Possibilities +title: Haz coincidir un solo carácter con múltiples posibilidades challengeType: 1 forumTopicId: 301357 dashedName: match-single-character-with-multiple-possibilities @@ -8,11 +8,11 @@ dashedName: match-single-character-with-multiple-possibilities # --description-- -You learned how to match literal patterns (`/literal/`) and wildcard character (`/./`). Those are the extremes of regular expressions, where one finds exact matches and the other matches everything. There are options that are a balance between the two extremes. +Aprendiste cómo hacer coincidir los patrones literales (`/literal/`) y el carácter de comodín (`/./`). Estos son los extremos de las expresiones regulares, donde uno encuentra coincidencias exactas y el otro coincide de todo. Hay opciones que representan un equilibrio entre los dos extremos. -You can search for a literal pattern with some flexibility with character classes. Character classes allow you to define a group of characters you wish to match by placing them inside square (`[` and `]`) brackets. +Puedes buscar un patrón literal con cierta flexibilidad utilizando las clases de caracteres. Las clases de caracteres te permiten definir un grupo de caracteres que deseas coincidir colocándolos dentro de corchetes (`[` y `]`). -For example, you want to match `"bag"`, `"big"`, and `"bug"` but not `"bog"`. You can create the regex `/b[aiu]g/` to do this. The `[aiu]` is the character class that will only match the characters `"a"`, `"i"`, or `"u"`. +Por ejemplo, si quieres hacer coincidir `bag`, `big`, y `bug` pero no `bog`. Puedes crear la expresión regular `/b[aiu]g/` para hacer esto. `[aiu]` es la clase de caracteres que solo coincidirá con los caracteres `a`, `i`, o `u`. ```js let bigStr = "big"; @@ -20,46 +20,47 @@ let bagStr = "bag"; let bugStr = "bug"; let bogStr = "bog"; let bgRegex = /b[aiu]g/; -bigStr.match(bgRegex); // Returns ["big"] -bagStr.match(bgRegex); // Returns ["bag"] -bugStr.match(bgRegex); // Returns ["bug"] -bogStr.match(bgRegex); // Returns null +bigStr.match(bgRegex); +bagStr.match(bgRegex); +bugStr.match(bgRegex); +bogStr.match(bgRegex); ``` +En orden, las cuatro llamadas de `match` devolverán los valores `["big"]`, `["bag"]`, `["bug"]`, and `null`. + # --instructions-- -Use a character class with vowels (`a`, `e`, `i`, `o`, `u`) in your regex `vowelRegex` to find all the vowels in the string `quoteSample`. +Usa una clase de caracteres con las vocales (`a`, `e`, `i`, `o` `u`) en tu expresión regular `vowelRegex` para encontrar todas las vocales en la cadena `quoteSample`. -**Note** -Be sure to match both upper- and lowercase vowels. +**Nota:** Asegúrate de hacer coincidir tanto las vocales mayúsculas como minúsculas. # --hints-- -You should find all 25 vowels. +Debes encontrar las 25 vocales. ```js assert(result.length == 25); ``` -Your regex `vowelRegex` should use a character class. +Tu expresión regular `vowelRegex` debe usar una clase de caracteres. ```js assert(/\[.*\]/.test(vowelRegex.source)); ``` -Your regex `vowelRegex` should use the global flag. +Tu expresión regular `vowelRegex` debe utilizar la bandera global. ```js assert(vowelRegex.flags.match(/g/).length == 1); ``` -Your regex `vowelRegex` should use the case insensitive flag. +Tu expresión regular `vowelRegex` debe utilizar la bandera que no distingue entre mayúsculas y minúsculas. ```js assert(vowelRegex.flags.match(/i/).length == 1); ``` -Your regex should not match any consonants. +Tu expresión regular no debe coincidir con ninguna consonante. ```js assert(!/[b-df-hj-np-tv-z]/gi.test(result.join())); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.md index a0f6672834..f9f71346d2 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.md @@ -1,6 +1,6 @@ --- id: 587d7db6367417b2b2512b98 -title: Match Single Characters Not Specified +title: Haz coincidir caracteres individuales no especificados challengeType: 1 forumTopicId: 301358 dashedName: match-single-characters-not-specified @@ -8,31 +8,31 @@ dashedName: match-single-characters-not-specified # --description-- -So far, you have created a set of characters that you want to match, but you could also create a set of characters that you do not want to match. These types of character sets are called negated character sets. +Hasta ahora, has creado un conjunto de caracteres que deseas coincidir, pero también podrías crear un conjunto de caracteres que no desees coincidir. Este tipo de conjuntos de caracteres se llaman conjuntos de caracteres negados. -To create a negated character set, you place a caret character (`^`) after the opening bracket and before the characters you do not want to match. +Para crear un conjunto de caracteres negados colocas un carácter de intercalación (`^`) después del corchete de apertura y antes de los caracteres que no quieres coincidir. -For example, `/[^aeiou]/gi` matches all characters that are not a vowel. Note that characters like `.`, `!`, `[`, `@`, `/` and white space are matched - the negated vowel character set only excludes the vowel characters. +Por ejemplo, `/[^aeiou]/gi` coincide con todos los caracteres que no son una vocal. Ten en cuenta que caracteres como `.`, `!`, `[`, `@`, `/` y el espacio en blanco coinciden; el conjunto de caracteres de vocal negados sólo excluye los caracteres de vocal. # --instructions-- -Create a single regex that matches all characters that are not a number or a vowel. Remember to include the appropriate flags in the regex. +Crea una sola expresión regular que coincida con todos los caracteres que no son un número o una vocal. Recuerda incluir las banderas apropiadas en la expresión regular. # --hints-- -Your regex `myRegex` should match 9 items. +Tu expresión regular `myRegex` debe coincidir con 9 elementos. ```js assert(result.length == 9); ``` -Your regex `myRegex` should use the global flag. +Tu expresión regular `myRegex` debe utilizar la bandera global. ```js assert(myRegex.flags.match(/g/).length == 1); ``` -Your regex `myRegex` should use the case insensitive flag. +Tu expresión regular `myRegex` debe utilizar la bandera que no distingue entre mayúsculas y minúsculas. ```js assert(myRegex.flags.match(/i/).length == 1); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.md index b59d501509..74e82a5b9a 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.md @@ -1,6 +1,6 @@ --- id: 587d7db8367417b2b2512ba3 -title: Match Whitespace +title: Haz coincidir espacios en blanco challengeType: 1 forumTopicId: 301359 dashedName: match-whitespace @@ -8,36 +8,36 @@ dashedName: match-whitespace # --description-- -The challenges so far have covered matching letters of the alphabet and numbers. You can also match the whitespace or spaces between letters. +Los desafíos por el momento han cubierto las letras que coinciden con el alfabeto y los números. También puedes hacer que coincidan los espacios en blanco o los espacios entre las letras. -You can search for whitespace using `\s`, which is a lowercase `s`. This pattern not only matches whitespace, but also carriage return, tab, form feed, and new line characters. You can think of it as similar to the character class `[ \r\t\f\n\v]`. +Puedes buscar los espacios en blanco usando `\s` que es una `s` minúscula. Este patrón no solo coincide con los espacios en blanco, también con los caracteres de retorno de carro, tabulaciones, alimentación de formulario y saltos de línea. Puedes pensar que es similar a las clases de caracteres `[ \r\t\f\n\v]`. ```js let whiteSpace = "Whitespace. Whitespace everywhere!" let spaceRegex = /\s/g; whiteSpace.match(spaceRegex); -// Returns [" ", " "] ``` +Esta llamada a `match` debe devolver `[" ", " "]`. # --instructions-- -Change the regex `countWhiteSpace` to look for multiple whitespace characters in a string. +Cambia la expresión regular `countWhiteSpace` para buscar múltiples caracteres de espacio en blanco en una cadena. # --hints-- -Your regex should use the global flag. +Tu expresión regular debe usar una bandera global. ```js assert(countWhiteSpace.global); ``` -Your regex should use the shorthand character `\s` to match all whitespace characters. +Tu expresión regular debe usar el carácter abreviado `\s` para que coincida con los caracteres de espacio en blanco. ```js assert(/\\s/.test(countWhiteSpace.source)); ``` -Your regex should find eight spaces in `"Men are from Mars and women are from Venus."` +Tu expresión regular debe encontrar ocho espacios en la cadena `Men are from Mars and women are from Venus.` ```js assert( @@ -46,13 +46,13 @@ assert( ); ``` -Your regex should find three spaces in `"Space: the final frontier."` +Tu expresión regular debe encontrar tres espacios en la cadena `Space: the final frontier.` ```js assert('Space: the final frontier.'.match(countWhiteSpace).length == 3); ``` -Your regex should find no spaces in `"MindYourPersonalSpace"` +Tu expresión no debe encontrar espacios en la cadena `MindYourPersonalSpace` ```js assert('MindYourPersonalSpace'.match(countWhiteSpace) == null); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md index 63496d7733..6685d54e7a 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md @@ -1,6 +1,6 @@ --- id: 587d7dbb367417b2b2512bac -title: Remove Whitespace from Start and End +title: Elimina espacio en blanco del inicio y final challengeType: 1 forumTopicId: 301362 dashedName: remove-whitespace-from-start-and-end @@ -8,29 +8,29 @@ dashedName: remove-whitespace-from-start-and-end # --description-- -Sometimes whitespace characters around strings are not wanted but are there. Typical processing of strings is to remove the whitespace at the start and end of it. +A veces no se quieren caracteres en espacios en blanco alrededor de las cadenas, pero están ahí. El proceso típico de las cadenas de texto es eliminar el espacio en blanco al inicio y al final del mismo. # --instructions-- -Write a regex and use the appropriate string methods to remove whitespace at the beginning and end of strings. +Escribe una expresión regular y usa los métodos de cadena apropiados para eliminar espacios en blanco al principio y al final de las cadenas. -**Note:** The `String.prototype.trim()` method would work here, but you'll need to complete this challenge using regular expressions. +**Nota:** El método `String.prototype.trim()` funcionará aquí, pero necesitarás completar este desafío usando expresiones regulares. # --hints-- -`result` should equal to `"Hello, World!"` +`result` debe ser igual a la cadena `Hello, World!` ```js assert(result == 'Hello, World!'); ``` -Your solution should not use the `String.prototype.trim()` method. +Tu solución no debe usar el método `String.prototype.trim()`. ```js assert(!code.match(/\.?[\s\S]*?trim/)); ``` -The `result` variable should not be set equal to a string. +La variable `result` no debe ser igual a una cadena. ```js assert(!code.match(/result\s*=\s*".*?"/)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.md index 8f7a68cc7b..45b051cc5c 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.md @@ -1,6 +1,6 @@ --- id: 587d7db9367417b2b2512ba7 -title: Specify Exact Number of Matches +title: Especifica el número exacto de coincidencias challengeType: 1 forumTopicId: 301365 dashedName: specify-exact-number-of-matches @@ -8,63 +8,65 @@ dashedName: specify-exact-number-of-matches # --description-- -You can specify the lower and upper number of patterns with quantity specifiers using curly brackets. Sometimes you only want a specific number of matches. +Puedes especificar el número inferior y superior de patrones mediante especificadores de cantidad utilizando llaves. A veces solo quieres un número específico de coincidencias. -To specify a certain number of patterns, just have that one number between the curly brackets. +Para especificar un cierto número de patrones, simplemente pon ese número entre corchetes. -For example, to match only the word `"hah"` with the letter `a` `3` times, your regex would be `/ha{3}h/`. +Por ejemplo, para que coincida con la palabra `hah` solo con la letra `a` `3` veces, tu expresión regular sera `/ha{3}h/`. ```js let A4 = "haaaah"; let A3 = "haaah"; let A100 = "h" + "a".repeat(100) + "h"; let multipleHA = /ha{3}h/; -multipleHA.test(A4); // Returns false -multipleHA.test(A3); // Returns true -multipleHA.test(A100); // Returns false +multipleHA.test(A4); +multipleHA.test(A3); +multipleHA.test(A100); ``` +En orden, las tres llamadas a `test` devuelven `false`, `true` y `false`. + # --instructions-- -Change the regex `timRegex` to match the word `"Timber"` only when it has four letter `m`'s. +Modifica la expresión regular `timRegex` para hacer coincidir con la palabra `Timber` solo cuando esta tiene cuatro letras `m`. # --hints-- -Your regex should use curly brackets. +La expresión regular debe utilizar corchetes. ```js assert(timRegex.source.match(/{.*?}/).length > 0); ``` -Your regex should not match `"Timber"` +La expresión regular no debe coincidir con la cadena `Timber` ```js timRegex.lastIndex = 0; assert(!timRegex.test('Timber')); ``` -Your regex should not match `"Timmber"` +La expresión regular no debe coincidir con la cadena `Timmber` ```js timRegex.lastIndex = 0; assert(!timRegex.test('Timmber')); ``` -Your regex should not match `"Timmmber"` +La expresión regular no debe coincidir con la cadena `Timmmber` ```js timRegex.lastIndex = 0; assert(!timRegex.test('Timmmber')); ``` -Your regex should match `"Timmmmber"` +La expresión regular debe coincidir con la cadena `Timmmmber` ```js timRegex.lastIndex = 0; assert(timRegex.test('Timmmmber')); ``` -Your regex should not match `"Timber"` with 30 `m`'s in it. +La expresión regular no debe coincidir con la cadena `Timber` con 30 `m`. ```js timRegex.lastIndex = 0;