See the latest update of documentation wiki in that most part of this 
thread has been documented

rev: 0.5
url: http://tw-regexp.tiddlyspot.com/

--Mohammad 

On Sunday, August 25, 2019 at 11:34:11 PM UTC+4:30, @TiddlyTweeter wrote:
>
> Mark S. wrote:
>>
>> I think he means "02" literally. Usually IP numbers aren't padded, so not 
>> sure.
>>
>> It's the range 0-255 that's problematic. Here's what I have for the range:
>>
>> <option value="^(\b\d\b|\b\d\d\b|1\d\d|2[0-4]\d|25[0-5])">IP range 
>> 0-256</option>
>>
>
> IF that means numbers 000 to 255 it looks doable.
>
> Hmm, I guess with an IP you could add the mandatory delimiter (usually 
>> ".") and repeat the group. But you would have to manually repeat the group 
>> at the end where the delimiter must not be.
>>
>
> That is quite easy in regex as you can make it just *"\.?"*. Repeat is 
> easy, just put the dot first on repeats.
>
> And then there's zero padding. Most of the IP numbers I've seen are not 
>> zero-padded, but ...
>>
>
> That is much more difficult in regex. So long as the system throws the 
> 0's away when not needed it may be okay?
>
> I think the first thing I would do is see what the internet says.
>>
>> A search for "regular expression ip address" immediately turns up a page 
>> from O'Reilly, with both a simple
>> version and an accurate version for checking IP. As I expected, they're 
>> able to do a repeat on the structure 3 times, but
>> have to do the last one by hand. They've figured out the 0 padding:
>>
>> ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
>>
>>
>> So ... no need to rebuild the wheel for most common use cases. Hmm, I 
>> wonder about IPv6 ?
>>
>
>
>> Ok, sorry for the stream-of-consciousness problem-working.
>>
>
> Its interesting & useful!
>
> TT
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0ec30d7d-d469-47eb-bb9f-11c412e1673b%40googlegroups.com.

Reply via email to