How to parse a string with ranges?

julia> Base._colon(parse.(Int, split("3:3:12", ':'))...)
3:3:12

This should not be the accepted answer. _colon is undocumented and underscore-prefixed, it should not be used in production code. A better solution (considering that is okay to throw an exception if the format is incorrect) is:

julia> (:)(parse.(Int, split("3:3:12", ':'))...)
3:3:12
3 Likes