Skip to content

Commit

Permalink
Added more regex for numeric (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathew-at-guelph authored Mar 26, 2024
1 parent 26316e5 commit 4df0a32
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export const formatCodeNumeric = [
"^(0?(\\.\\d+)?|1(\\.0+)?)$",
"^[0-9]*[1-9][0-9]*$",
"^-?[0-9]+$",
"^(100(\\.0+)?|0*([1-9]?\\d(\\.\\d+)?)|0)$"
"^(100(\\.0+)?|0*([1-9]?\\d(\\.\\d+)?)|0)$",
"^[NS]-?(?:[0-8]?\\d|90)°(?:\\d+(?:\\.\\d+)?)(?:'(\\d+(?:\\.\\d+)?)\")?$",
"^[WE]-?(?:[0-8]?\\d|90)°(?:\\d+(?:\\.\\d+)?)(?:'(\\d+(?:\\.\\d+)?)\")?$"
];

export const formatCodeNumericDescription = {
Expand All @@ -169,7 +171,9 @@ export const formatCodeNumericDescription = {
"^(0?(\\.\\d+)?|1(\\.0+)?)$": "decimal numbers between 0 and 1, inclusive",
"^[0-9]*[1-9][0-9]*$": "positive integers",
"^-?[0-9]+$": "any integer",
"^(100(\\.0+)?|0*([1-9]?\\d(\\.\\d+)?)|0)$": "any number between 0 and 100, inclusive"
"^(100(\\.0+)?|0*([1-9]?\\d(\\.\\d+)?)|0)$": "any number between 0 and 100, inclusive",
"^[NS]-?(?:[0-8]?\\d|90)°(?:\\d+(?:\\.\\d+)?)(?:'(\\d+(?:\\.\\d+)?)\")?$": "Latitude in formats S30°15'45.678\" or N12°30.999\"",
"^[WE]-?(?:[0-8]?\\d|90)°(?:\\d+(?:\\.\\d+)?)(?:'(\\d+(?:\\.\\d+)?)\")?$": "Longitude in formats E30°15'45.678\" or W90°00.000\""
};

export const formatCodeDate = [
Expand Down

0 comments on commit 4df0a32

Please sign in to comment.