Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
navitas28857yI'm so sleepy so I'm not sure if I'm getting your requirements correctly.
I'm assuming you want to pass in a string like "Hello mycroChip, you are human" and then have it return something like { name: "mycroChip", face: "human" }, right?
In that case, you should probably use this:
https://github.com/ishan-marikar/...
It's a fork of a library a friend of mine did (which has been since archived) based on a similar module in python. It uses regular expressions to do that.
npm install ishan-marikar/extract-values
.. also, always review code before you import it into projects. Make that a habit. -
Thanks for the input guys, I've also considered using libs.. but after google here and there, finally i used a regex which is:
\{{.*?\}}
Its solved now and really that simple, I think i need a break lol
The specs should be able to get the parameter inside parentheses, I think thats all, once again thanks a bunch

This never gets old...
Exactly
¯\_(ツ)_/¯
Need a bit help here, its pretty easy, suppose i have string "Hello {{name}}, you are {{face}}".
How can I process this string so that in return I'll get something like ["name","face"], any ideas to solve this in node js? thanks a bunch
rant
javascript