aboutsummaryrefslogtreecommitdiff
path: root/src/tiles.rs
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-10-01 17:07:35 (UTC)
committerjan <jan@ruken.pw>2016-10-01 17:07:35 (UTC)
commit9138d3e359fcf7283b78f48c8d2d58a492814773 (patch)
tree3997199c187d64c662f69206e2b95da85536fe96 /src/tiles.rs
parentad63b49b94bf4b4596e6420e37d265a57b77d731 (diff)
assignments & chars mit aehnlichen traits
Diffstat (limited to 'src/tiles.rs')
-rw-r--r--src/tiles.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tiles.rs b/src/tiles.rs
new file mode 100644
index 0000000..1ed7320
--- /dev/null
+++ b/src/tiles.rs
@@ -0,0 +1,9 @@
1use super::regex::Regex;
2
3use std::str::FromStr;
4
5pub fn parse_tile_link_ids(s: &str, php_file: &str) -> Vec<u32> {
6 let re = Regex::new(&format!(r#"(?is)<A href="{}\.php\?id=([0-9]+)"><IMG"#, php_file)).unwrap();
7
8 re.captures_iter(s).map(|cap| u32::from_str(cap.at(1).unwrap()).unwrap()).collect()
9}