From: Harishankar Date: Sun, 31 May 2020 13:40:50 +0000 (+0530) Subject: Added support for negative numbers X-Git-Tag: 0.1.2^0 X-Git-Url: https://harishankar.org/repos/?p=evpf.git;a=commitdiff_plain;h=9256309493832e5c88f8f019c2603807b8bf74d8 Added support for negative numbers Fixed the regular expression to support negative numbers. Also bumped version to 0.1.2 (beta) --- diff --git a/Cargo.lock b/Cargo.lock index 42482f2..719fe34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,7 +125,7 @@ dependencies = [ [[package]] name = "evpf" -version = "0.1.0" +version = "0.1.1" dependencies = [ "colored", "regex", diff --git a/Cargo.toml b/Cargo.toml index 817272d..723b9b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evpf" -version = "0.1.1" +version = "0.1.2" authors = ["Harishankar "] edition = "2018" diff --git a/src/main.rs b/src/main.rs index c5dd52e..d44387c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,7 +261,7 @@ fn main() { // collect the command line arguments - if any let args : Vec = env::args().collect (); // regular expression to match a number - let match_num = Regex::new (r"^\d+?\.*?\d*?$").unwrap (); + let match_num = Regex::new (r"^\-?\d+?\.*?\d*?$").unwrap (); if args.len () > 1 { // if arguments are provided run in command line mode - i.e. print the