From 9256309493832e5c88f8f019c2603807b8bf74d8 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Sun, 31 May 2020 19:10:50 +0530 Subject: [PATCH] Added support for negative numbers Fixed the regular expression to support negative numbers. Also bumped version to 0.1.2 (beta) --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.20.1