Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(([\+\-NnSs])?([0-8]?\d|90)[°˚º^~*\s\-_]+([0-5]?\d|\d)['′\s\-_]+([0-5]?\d|\d)([.]\d*)?["¨˝\s\-_]*([\+\-NnSs])?)([\s\-_:|,;\/\\]+)(([\+\-EeWw])?([0]?\d?\d|1[0-7]\d|180)[°˚º^~*\s\-_]+([0-5]\d|\d)['′\s\-_]+([0-5]?\d|\d)([.]\d*)?["¨˝\s_]*([\+\-EeWw])?)[\s]*$
/
mg

Description

Checks DMS given in Latitude / Longitude order

Submitted by Anthony Giles - 8 years ago