From 14e467814b36f204695cd878e3d89e3211a882b8 Mon Sep 17 00:00:00 2001 From: Ed Paradis Date: Mon, 29 Aug 2022 18:01:31 -0700 Subject: [PATCH] optionally match decimal points Should prevent an error where integers were not being processed --- goskew.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/goskew.go b/goskew.go index 4a7c033..09ae8cf 100644 --- a/goskew.go +++ b/goskew.go @@ -54,9 +54,9 @@ func skew(input []byte, xytan float64, xztan float64, yztan float64) string { xin, yin, zin := 0.0, 0.0, 0.0 // init the regular expressions - xreg, _ := regexp.Compile(`[xX](-?\d*\.\d*)`) - yreg, _ := regexp.Compile(`[yY](-?\d*\.\d*)`) - zreg, _ := regexp.Compile(`[zZ](-?\d*\.\d*)`) + xreg, _ := regexp.Compile(`[xX](-?\d*\.?\d*)`) + yreg, _ := regexp.Compile(`[yY](-?\d*\.?\d*)`) + zreg, _ := regexp.Compile(`[zZ](-?\d*\.?\d*)`) for i, line := range lines { gmatch, _ := regexp.MatchString(`G[0-1]`, line)