The library CL-PPCRE provides the function split which allows us to split strings in substrings that match a regular expression, discarding the parts of the string that do not.
(cl-ppcre:split "\\." "127.0.0.1")
;; => ("127" "0" "0" "1"...