Content deleted Content added
→More than 3 digits in a group: questions, question |
|||
Line 23:
::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)
::::i did it the way i thought is right, i.e., disallow leading 0 (i.e., 0 is OK, but 02 or 00 is not). this cause one test to fail, for the string "00.00.00.00". not sure if this should fail (your answer above indicate you think it should), in which case we need to modify the test, or maybe it should pass, in which case we should modify the code. wither is easy. can someone point to an authoritative source that explains which of the following (if any) is legal?
00.00.00.00
000000012.13.14.15
012.13.14.15
01.02.03.04
::::if no authoritative source can be found, your opinion will be appreciated anyway. also, is there past behavior we should emulate, regardless of "what's right"? thanks. peace - [[User:קיפודנחש|קיפודנחש (aka kipod)]] ([[User talk:קיפודנחש|talk]]) 16:37, 8 March 2013 (UTC)
|