I tried converting this:
$regex = "/^[0-9]+[0-9\.]*(?<!\.)$/"
to all of these, but none are correct:
var regex = /^(?!\.$)[0-9]+[0-9\.]*/;
var regex = /^(?!.*\.$)[0-9]+[0-9\.]*/;
var regex = /^[0-9]+[0-9\.]*(?!\.$)/;
The PHP regex correctly rejects 1.1a and 1., but the javascript regex's do not.