let quotedText = /'([^']*)'/;
console.log(quotedText.exec("she said 'hello'"));
// → ["'hello'", "hello"]
Would (.*) be more appropriate here since you're already covering the apostrophes at the beginning and end of the regular expression? Especially since something like "she said 'what's up'" would break the regular expression currently shown (not that it actually matters for this specific example).
In this example: http://eloquentjavascript.net/09_regexp.html#c_5E2M1BBsUm
Would
(.*)
be more appropriate here since you're already covering the apostrophes at the beginning and end of the regular expression? Especially since something like "she said 'what's up'" would break the regular expression currently shown (not that it actually matters for this specific example).