Regular Expressions 101

Community Patterns

Lat Long

0

Regular Expression
PCRE (PHP <7.3)

/
([+-])?(\d\d)(?:(:?)|\*)([0-5]\d)(?:(?:(\3)|\')((?:[0-5]\d)(?:\.\d+)?))?([NS])?\/([+-])?([01]\d\d)\3([0-5]\d)(?:\3((?:[0-5]\d)(?:\.\d+)?))?([EW])?\b
/
g

Description

Lat long in format matching the following: DDMM/DDDMM DDMMSS/DDDMMSS DDMMSS.S/DDDMMSS.S

With or without NSEW, colons or +- in front.

Submitted by anonymous - 7 years ago