Estoy tratando de obtener información entre comillas en node.js
Por ejemplo:
var information = 'Hello "beautiful and amazing" world.' ¿Cómo puedo registrar el contenido escrito dentro del " " ? Quiero obtener esto como resultado: beautiful and amazing .
Usando expresiones regulares:
var information = 'Hello "beautiful and amazing" world.' var regex = /".+"/ var match = information.match(regex) var res = match?.[0].slice(1, match[0].length - 1) console.log("Result: " + res) Esto verifica " luego cualquier texto, luego otro " . Luego quita la " s"