andreasgal/PhoneNumber.js — pull request #21 by janjongboom (2013-04-17 12:54:44+00:00)
Title: Bug 862232 - China mobile number will remove first 0

The `nationalPrefixForParsing` for China is `(1[1279]\d{3})|0`. We make this into a regex by prefixing this with `^`. Because the `|0` the first 0 is matched if the first group is not matched at pos 0.

```
'9990999'.match(/^(1[1279]\d{3})|0/)
["0"]
```

I wrap the regex'es now in a non matching group so we don't have this problem anymore.