Jquery ipmask plugin for input ip v4

For the admin there was a task - to make it convenient to enter ip-addresses.
The existing plugins did not suit with the fact that they either did not accurately check the format and allowed to enter ip type 264.734.443.332, or did not know how to set the delimiters themselves, or when entering an octet larger than 255 was reduced to the smallest, i.e. when entering 665 instead of putting the separator dot after 66, i.e. make 66.5 reduced to 255, i.e. no convenience.
As a result, there was a desire to make a plug-in that would allow you to enter only numbers, and point separators would be set themselves in the right places, when possible.
This is my first plugin, there was no creation experience, I decided to remake an existing similar plugin.
In order not to make a lot of conditions and exceptions for checking the input of characters, it was decided to check the entered string by regular expression. If each character entered matches, fine. If not, then try this delimited character.
One regular expression checks the complete string of the ip address, the other checks the string whether it can be part of the ip address.
As a result, the code turned out to be small and the plug-in performs the main function.
If someone needs
an example of the plugin (updated 03/07/2014)
github
From what could be done:
Of course, it would be a plus to enter ip.v6, and with support for the short form, I think to do it as soon as it is needed in our admin panel .
upt (03/07/2014):
- Bugs fixed
- Placeholder
added - Added the ability to edit individual octets.