So, I'm trying to write a regex that matches all numbers. Here is that regex:
/\b[\d \.]+\b/g
And I try to use it on the string:
100 two 100
And everything works fine; it matches both of the numbers.
But I want to rewrite the regex in the form:
new RegExp(pattern,modifiers)
Because I think it looks clearer. So I write it like this:
new RegExp('\b[\d \.]+\b','g')
But now it won't match the former test string. I have tried everything, but I just can't get it to work. What am I doing wrong?
