Folks, Sorry for my absence for a while. The IP address idea the first character in each number should be [0-2] because only 0, 1 and 2 are valid in the hundreds position.
The idea would be to accept a value such as 124.3.0.1 and determine if it was valid ie no number between the dots should be other than a number from 0-255 Ok we may not be able to avoid 299 being used but we could att a test that the whole number not be greater than 255 Separate tests could check for 10.*.*.* 192.168.*.* 127.*.*.* or if equal to 1.1.1.1 or 0.0.0.0. to determine if they are local or public addresses. Such a facility would allow tiddlywiki to become a DNS database and more as it relates to IP Addresses. Especially TiddlyDesktop that could launch pings and NSLookups, trace and more including opening the sites in an iframe. I have always believed that Tiddlywiki would make a good platform for the following - Network and Operations database and dashboard - Configuration management database - Website and device directory - System Change management Not to mention my quite old idea of building device wiki that has all the details about a device including config settings, manuals, diagnostic methods and the device wiki can be stored in a repository and a copy on a usb stick secured to the device. A OTG USB cable adaptor would allow you to open the device wiki with a mobile device and where valid if the device has storage even host the wiki on the device and access it over the network eg; the usb port on your router. So a macro and regex that makes IP Addresses trivial to handle will be a boon to these applications. Regards Tony On Monday, August 26, 2019 at 5:31:33 AM UTC+10, Mohammad wrote: > > 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/ec4e2b09-3a4f-44cc-a23f-8414cb041c3f%40googlegroups.com.

