I have the following jQuery call, which returns a match in FF/Chrome, but returns null in IE 8.
Here\'s the fiddle if you\'d like to try it for yourself.
And her
Your code would only replace the first occurence of
. However, since you're getting the text using .text()
, the replace
function should not be needed.
var m = t.replace(/ /g, ' ').match(/\d+-(\d+)\sof\s(\d+)/);
If your issue is not solved using the previous line, use alert(t)
to check whether the input is as expected.