in reply to Problems with formatting the results of my regex
#!/usr/bin/perl -w use strict; my $in ="20120704 00:05:53.46;CmdTask(0);EV;FBLdxPreAlignment rtn=0, Y +offset=-4278 "; #desired: 20120704,00:05:53.46,,,-4278 my ($num, $time, $offset) = $in =~ /\s*(\d+)\s+([\d:.]+).*=([-\d]+)\s* +$/; print "$num,$time,,,$offset\n"; __END__ prints: 20120704,00:05:53.46,,,-4278
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems with formatting the results of my regex
by superwombat (Acolyte) on Jul 07, 2012 at 08:19 UTC | |
|
Re^2: Problems with formatting the results of my regex
by monsoon (Pilgrim) on Jul 07, 2012 at 07:53 UTC | |
by superwombat (Acolyte) on Jul 07, 2012 at 08:08 UTC | |
by Marshall (Canon) on Jul 09, 2012 at 04:42 UTC |