This regular expression is a bit more "future proof" than mathepic's answer:
Android (\d+(?:\.\d+)*);
It allows for multiple digits in each place as well as additional periods in the version number. Android's been out 3 years and we're on 3.0. Eventually we'll get to 10.0.0.
This will catch all of the following:
- 1.6 (real)
- 2.3.4 (real)
- 9
- 12.34.56 (fake. but one day...)
- 3.4.5.6 and 4.5.6.7.8.9 (fake... but just in case)
This could be written a little more strictly as:
Android (\d+(?:\.\d+){0,2});
This sticks more closely to the schema we've already seen used, but could potentially miss some versions of they decide to add an additional .1
at the end of a version. It also matches for the future 10.0.0
version.