Skip to content

Commit 1c958bb

Browse files
committed
proper url regex with added character
1 parent 6c1bce2 commit 1c958bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "leth"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
authors = ["fcd <[email protected]>"]
55
edition = "2018"
66

src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ use std::process::Command;
99
use regex::Regex;
1010
use skim::{Skim, SkimOptionsBuilder};
1111

12+
const URL_REGEX: &str = r"(http(?:s)://[a-zA-Z0-9_/?+&.=@-]+)";
13+
1214
pub fn main() {
1315
let options = SkimOptionsBuilder::default()
1416
.multi(true)
1517
.bind(vec!["ctrl-k:kill-line"])
1618
.build()
1719
.unwrap();
1820

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

0 commit comments

Comments
 (0)