JSFiddle - React, Tailwind, and code Playground

JavaScript

var str = "the word you need is 'hello'";
var singleQuoted = $.map(str.split("'"), function(substr, i) {
   return (i % 2) ? substr : null;
});

alert(singleQuoted.join("\n"));