Skip to content

Commit

Permalink
Merge pull request #24 from alexhallam/adjust_float_regex
Browse files Browse the repository at this point in the history
fix #23
  • Loading branch information
alexhallam committed Aug 1, 2021
2 parents 7a7d19d + d5fd806 commit 2d460ea
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 126 deletions.
166 changes: 166 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
[package]
name = "tidy-viewer"
version = "0.0.5"
authors = ["alexhallam <alexhallam6.28@gmail.com>"]
edition = "2018"
categories = ["command-line-utilities"]
description = "Head, but for csvs and with color"
edition = "2018"
keywords = ["csv", "pretty-print", "data-viewer", "tv", "tabular-data-viewer"]
license = "Unlicense/MIT"
repository = "https://github.com/alexhallam/tv"
name = "tidy-viewer"
readme = "README.md"
keywords = ["csv", "pretty-print","data-viewer","tv","tabular-data-viewer"]
categories = ["command-line-utilities"]
repository = "https://github.com/alexhallam/tv"
version = "0.0.5"

[dependencies]
console = "0.14.1"
tabwriter = "1.2.1"
crossterm = "0.20.0"
csv = "1.1.6"
itertools = "0.10.0"
lazy_static = "1.4.0"
owo-colors = "1.3.0"
pad = "0.1"
regex = "1.4.5"
csv = "1.1.6"
structopt = "0.3.21"
itertools = "0.10.0"
lazy_static = "1.4.0"
tabwriter = "1.2.1"
1 change: 1 addition & 0 deletions data/a.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ name,value,bool,date
"abcdefghijklmnop",10,F,2021-01-01
"",100,,2021-01-01
"n/a","",F,2021-01-01
"floatlike",2/ 2.5 Gallon,F,2021-01-01
2 changes: 1 addition & 1 deletion src/datatype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn is_double(text: &str) -> bool {
lazy_static! {
// for exp values, but seems to match other strings also
//static ref R: Regex = Regex::new(r"[+-]?[0-9]+(\.[0-9]+)?([Ee][+-]?[0-9]+)?").unwrap();
static ref R: Regex = Regex::new(r"[+-]?[0-9]?+(\.[0-9]+)([Ee][+-]?[0-9]+)?").unwrap();
static ref R: Regex = Regex::new(r"^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)$").unwrap();

}
let lgl = R.is_match(&text);
Expand Down

0 comments on commit 2d460ea

Please sign in to comment.