Content deleted Content added
Line 22:
:current code allows those, as well as 1.00000000100.2.2, i.e, any number can be preceded by any number of 0's. it's relatively easy to disallow. from [[Dot-decimal notation#Caveat]] it can be concluded that preceding with 0's is not a good idea, and can lead to confusion- this may be interpreted sometimes to mean "octal". should i change the code to disallow? should we add it to the tests? peace - [[User:קיפודנחש|קיפודנחש (aka kipod)]] ([[User talk:קיפודנחש|talk]]) 09:06, 8 March 2013 (UTC)
::Yes, I think it is better to disallow. I would change the regexp from "^(%d+)%.(%d+)%.(%d+)%.(%d+)$" to something like "^(%d{1,3})%.(%d{1,3})%.(%d{1,3})%.(%d{1,3})$". --[[User:DixonD|DixonD]] ([[User talk:DixonD|talk]]) 12:11, 8 March 2013 (UTC)
:::technically, what you suggest is not viable, because lua's string comparison is not real regex, and specifically, there's no support for quantifiers in curlies. It would also still allow 000 or 020 etc., which should also be disallowed. However, as i mentioned, the solution is not difficult. --[[User:קיפודנחש|קיפודנחש (aka kipod)]] ([[User talk:קיפודנחש|talk]]) 14:11, 8 March 2013 (UTC)
|