1

I know these are asked a lot, I'm having trouble finding my specific flag or option to solve this problem.

var str = "++z+z+z++"
console.log(str.match(/[\+][a-z][\+]/g)); //returns ["+z+", "+z+"]

trying to return ['+z+','+z+','+z+'] as long as the letter is surrounded by a + symbol its fine.

CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
Wolf_Tru
  • 523
  • 7
  • 19

0 Answers0