←back to thread

Regex Isn't Hard (2023)

(timkellogg.me)
75 points asicsp | 1 comments | | HN request time: 0.227s | source
1. evertedsphere ◴[] No.43750565[source]

  This pattern ([0-9][0-9]?[0-9]][.])+ matches one, two or three digits followed by a . and also matches repeated patterns of this. This wold match an IP address (albeit not strictly).
that pattern (once you fixed the typo) would not match a whole ip address unless you allowed it to also swallow the character after the last octet, which wouldn't work at, say, end of line