I am having some trouble with my regex in javascript. I have the following code, that I think should match, but it doesn't.
var rgx = new RegExp("{\d+:(\d+)}"); if (rgx.test("{0:00000}") == true) { alert("match"); } else { alert("no match"); } I am unsure if I should use test() here. I really want to catch the group, in my regex but exec() seems to give me the same result.
So what am I doing wrong?
^at the beginning and$at the end as well, to make sure the string matches completely and not a substring - but that's up to you.