Soy nuevo en expresiones regulares. Tengo esto :
'@time-transform{ [bg:red;c:white] [bg:black] [bg:white;c:black] }'Quiero la parte dentro de corchetes.
Puede dividir la cadena por expresiones regulares:
const result = input.split(/({|})/)[2];Parece que también se puede hacer sin expresiones regulares aunque.
const text = '@time-transform{[bg:red;c:white][bg:black][bg:white;c:black]}'; const result = text.substring(text.indexOf('{') + 1, text.indexOf('}')); console.log(result); // logged: '[bg:red;c:white][bg:black][bg:white;c:black]' (string)