Splits a path into segments.
static List<String> segments(String path) { path = path.startsWith("/") ? path.substring(1) : path; return RegExp(_pathRegs).hasMatch(path) ? path.split("/") : []; }