[SP-pm] Separar o primeiro do resto

Renato Santos renato.cron at gmail.com
Tue Apr 30 15:50:08 PDT 2013


ou se for mais maluco

m/(.)(.+)/


2013/4/30 Lucas Moraes <lucastiagodemoraes at gmail.com>

> com regex você faz isso
> m{(\d{1})(\d{1,})}s;
> $1, $2
>
>
> Em 30 de abril de 2013 19:37, Tiago Peczenyj <tiago.peczenyj at gmail.com>escreveu:
>
>> Seguinte: tenho X bytes como
>>
>> $x="12345"
>>
>> E quero pegar o primeiro e o resto:
>>
>> ($a,$b) = magica $x;
>>
>> $a = 1
>> $b = 2345
>>
>> Comofas?
>>
>> Eu posso fazer bytes::substr 2 vezes mas ta feio...
>>
>> =begin disclaimer
>>    Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>>  SaoPaulo-pm mailing list: SaoPaulo-pm at pm.org
>>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
>> =end disclaimer
>>
>>
>
> =begin disclaimer
>    Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>  SaoPaulo-pm mailing list: SaoPaulo-pm at pm.org
>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
> =end disclaimer
>
>


-- 
Saravá,
Renato CRON
http://www.renatocron.com/blog/
@renato_cron <http://twitter.com/#!/renato_cron>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20130430/37fa1ac1/attachment.html>


More information about the SaoPaulo-pm mailing list