You are viewing a single comment's thread. Return to all comments →
In Javascript
const lines = input.split("\n"); lines.shift(); const regex = /^\([-+]?([1-8]\d(\.\d+)?|90(\.0+)?|\d(\.\d+)?),\s[-+]?(1[0-7]\d(\.\d+)?|180(\.0+)?|\d{1,2}(\.\d+)?)\)$/g; lines.forEach((line) => { if (!line) { return; } const status = line.match(regex) ? 'Valid' : 'Invalid'; console.log(status); });
Seems like cookies are disabled on this browser, please enable them to open this website
Detecting Valid Latitude and Longitude Pairs
You are viewing a single comment's thread. Return to all comments →
In Javascript