mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Float regex: Don't allow double dot; do allow 'e' for exponentials
This commit is contained in:
@@ -36,7 +36,7 @@ trait DatatypeTrait {
|
|||||||
return 'integer';
|
return 'integer';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^[+-]?([0-9]*[.])?([0-9]|[.][0-9])+$/', $value)) {
|
if (preg_match('/(^[+-]?$)|(^[+-]?[0-9]+([,.][0-9])?[0-9]*(e[+-]?[0-9]+)?$)/', $value)) {
|
||||||
return 'float';
|
return 'float';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user