I have a string like so: {{q:6}}
I need to be able to make a regex to take it and turn it into this:
“Question Here”
The Regex would need to ignore {{q: and would need to be [0-9] for any number from 0 to 100.
var final_value = value.replace(/^{{q:([0-9]+)$}}/g, 'question');
Using it in this context ^, but this isn’t working. Any thoughts?
Thanks in advance!
EDIT:
Final working answer:
value.replace(/\{\{q:([0-9]+)\}\}/g, question);
This is java, a general answer would be:
"/\{\{q:([0-9]+)\}\}/g"