I’m trying to grab post counts from a users on a forum.
if (td[i].innerHTML.match("Posts: (\d+)")) {
postCount = RegExp.$1;
}
It works, but if a number is in the thousands, it only grabs the first number. How can this be adjusted to grab the entire number such as 1,000?
I have never seen this way of using regular expressions. But this should do it:
This wouldn’t match
1,000,000though, if you want to cover all cases, change?to*: