Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

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

Description

Checks DMS given in Longitude / Latitude order

Submitted by Anthony Giles - 8 years ago