Help make a regular season
#1,0.71,1.42,45.0,1.2$ This is the source text that is # parameter1, parameter2, parameter3, parameter4, parameter5 $
Tried so but without result #(?<id>),*,*,*,*$
Help make a regular season
#1,0.71,1.42,45.0,1.2$ This is the source text that is # parameter1, parameter2, parameter3, parameter4, parameter5 $
Tried so but without result #(?<id>),*,*,*,*$
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
If I understood correctly:
#!/usr/bin/env perl use Modern::Perl; use Data::Printer; my $text = '#1,0.71,1.42,45.0,1.2$'; my @data; $text =~ /^#(.+)\$$/ and @data = split ',', $1; p @data; Conclusion:
[ [0] 1, [1] 0.71, [2] 1.42, [3] 45.0, [4] 1.2 ] Or in PHP:
$text = '#1,0.71,1.42,45.0,1.2$'; $data = explode( ',', trim( $text, '$#' ) ); print_r( $data ); Conclusion:
Array ( [0] => 1 [1] => 0.71 [2] => 1.42 [3] => 45.0 [4] => 1.2 ) Source: https://ru.stackoverflow.com/questions/571505/
All Articles