// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
uselazy_static::lazy_static;useregex::Regex;/// Given a resource_uri, attempts to parse the id from it
pubfnextract_id(s:&str)->Option<&str>{lazy_static!{staticrefRE: Regex =Regex::new(r"^/?api/[^/]+/(\d+)/?$").unwrap();}let x =RE.captures(s)?;
x.get(1).map(|x|x.as_str())}