summaryrefslogtreecommitdiff
path: root/string_utils.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1970-01-01 09:56:58 +0900
committerroot <root@avtech.domain.avtechpulse.com>1970-01-01 09:56:58 +0900
commit9aefe23f87a290cfa47095949a5b353a395e0578 (patch)
tree2cf704314878515d9535f9cb25537fd38ae7485f /string_utils.c
parentade4340d3b9e199084408cc1cf3916d136d92e9e (diff)
fix numeric string detection in parameter/units by anchoring regex
Diffstat (limited to 'string_utils.c')
-rw-r--r--string_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string_utils.c b/string_utils.c
index 7fba9bb..3087060 100644
--- a/string_utils.c
+++ b/string_utils.c
@@ -26,7 +26,7 @@ void Float_To_Text(int decimal_digits,float number_in, gchar ** text_out)
gboolean String_is_it_numeric(char *parameter)
{
- GRegex *numeric_regex = g_regex_new ( "\\s*[+-]?(\\d*\\.\\d+|\\d+(\\.\\d*)?)\\s*(e\\s*[+-]?\\d+)?\\s*",
+ GRegex *numeric_regex = g_regex_new ( "^\\s*[+-]?(\\d*\\.\\d+|\\d+(\\.\\d*)?)\\s*(e\\s*[+-]?\\d+)?\\s*$",
G_REGEX_CASELESS,
0,
NULL);