Perl Pattern Matching

Soldato
Joined
14 Feb 2006
Posts
4,644
Location
Surrey, UK
Evening all,

Anyone any good at this?

Basically I have a UTC time in a string in ISO 8601 format, looks something like

2008-11-26T18:01:13.00Z

I need a string which is just "hhmmss". Can anyone write a
$formatted =~ XYZ
type thing for me to do this?

Would appreciate it a lot.

Jon
 
Edit: done it.

For those who care I used:
$result =~ m/GPSD,D=(\d+)-(\d+)-(\d+)\w(\d+):(\d+):(\d+)\.(\d+)\w/;

The GPSD bit is because this is interpreting a serial GPS device on a Linux machine.

Please could a Don close this? Thanks
 
Fantastic, thanks everyone. The system has a lot of testing coming its way in the next few months, and if my way doesn't work I'll try yours daven.

The device is a TS-7260 Single Board system running Debian, if you're interested. It's being used as a flight computer in a weather balloon.

Thanks again :)
 
Back
Top Bottom