Created
July 29, 2012 21:00
-
-
Save gatlin/3201811 to your computer and use it in GitHub Desktop.
Simple regex for DMS angle notation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.16; | |
use strict; | |
use warnings; | |
while (my $str = <STDIN>) { | |
say "DMS" if $str =~ | |
m/([0-9]+(\W*)deg((ree)?s?)?)?(\W*)([0-9]+(\W*)min((ute)?s?)?)?(\W*)([0-9]+(\.[0-9]*)?(\W*)sec((ond)?s?)?)?/; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment