Tell us what’s happening:
Where is my wrong I can understand what to do with this code?
Your code so far
// example crowd gathering
let crowd = 'P1P2P3P4P5P6CCCP7P8P9';
let reCriminals = /CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC/; // Change this line
let matchedCriminals = crowd.match(reCriminals);
console.log(matchedCriminals);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt/
This ccccc… match with fifty criminals right?
In my exercise tell me that :
Your regex should match fifty criminals (“CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC”) in “P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3”.
I have got three right and three wrong.
// example crowd gathering
let crowd = ‘P1P2P3P4P5P6CCCP7P8P9’;
let reCriminals = /c+/gi; // Change this line
let matchedCriminals = crowd.match(reCriminals);
console.log(matchedCriminals);
That is right??
Ohh yes I try it and it is right.Thank you.
So this can’t be right, i know i’m lazy but … hmmm
Your code so far
// example crowd gathering
let crowd = 'P1P2P3P4P5P6CCCP7P8P9';
let reCriminals = /C+/; // Change this line
let matchedCriminals = crowd.match(reCriminals);
console.log(matchedCriminals);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3523.0 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt