Issue
I want to create an expression parser (in javascript but also examples in other languages welcomed) to grab values inside the ${ } tag.
So in the case of ${ foo bar } i want to extract "foo bar"
Thanks in advance!
Solution
This works in typescript.
var exp = (/(?<=\${)(.*?)(?=})/g);
console.log("${foo bar} ${test 1} no test ${test 2}".match(exp));
Output
[LOG]: ["foo bar", "test 1", "test 2"]
Answered By - Jagraj Singh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.