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
  • 313,535
  • 40
  • 245
  • 254
Wolf_Tru
  • 485
  • 6
  • 17

0 Answers0