Skip to content

Commit

Permalink
proper url regex with added character
Browse files Browse the repository at this point in the history
  • Loading branch information
femnad committed Feb 23, 2020
1 parent 6c1bce2 commit 1c958bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "leth"
version = "0.1.2"
version = "0.1.3"
authors = ["fcd <[email protected]>"]
edition = "2018"

Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ use std::process::Command;
use regex::Regex;
use skim::{Skim, SkimOptionsBuilder};

const URL_REGEX: &str = r"(http(?:s)://[a-zA-Z0-9_/?+&.=@-]+)";

pub fn main() {
let options = SkimOptionsBuilder::default()
.multi(true)
.bind(vec!["ctrl-k:kill-line"])
.build()
.unwrap();

let re = Regex::new(r"(http(?:s)://[a-zA-Z0-9_/?+&.=-]+)").unwrap();
let re = Regex::new(URL_REGEX).unwrap();
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer).unwrap();
let lines = buffer.split("\n");
Expand Down

0 comments on commit 1c958bb

Please sign in to comment.