[OZAPRS] APRS PERL SPLIT Help needed
Hamish Moffatt
hamish at cloud.net.au
Fri Sep 26 21:48:33 EST 2003
On Wed, Sep 24, 2003 at 11:25:28PM +1000, Andrew Rich wrote:
> I am feeling very dumb today I need some help with this PERL code.
>
> STRING = CALLSIGN>DEST,DIGI,DIGI,DIGI:PAYLOAD
>
> I am trying to get: CALLSIGN, DEST, (digis), PAYLOAD
>
> Code:-
>
> @callsign = split />/;
> @payload = split/:/;
> @dest = split /[>,]/;
> @digis = < this is the bit i am having probs with >
Split is the wrong function to use for this sort of function - use
regular expressions to grab the text before the >, text between the >
and first comma (if any), text between the first command the the :, then
text after the colon. Simple.
Hamish
--
Hamish Moffatt VK3SB <hamish at debian.org> <hamish at cloud.net.au>
_______________________________________________
ozaprs mailing list
ozaprs at marconi.ics.mq.edu.au
http://marconi.ics.mq.edu.au/cgi-bin/mailman/listinfo/ozaprs
More information about the Ozaprs
mailing list