How can I extract the data that is inside the brackets with their respective position?
let str = 'Aqui esta [pepe] y [pepito]';
resultado=str.split(" ")
[ 'Aqui', 'esta', '[pepe]', 'y', '[pepito]' ]
in this case you should get the word pepe in position 2 and 4 in pepito to be able to save an object with the position and the word