Its hard to describe what I would do. So I show it on example.
My string:
my $string = q(
min_entry = -0.236, 0, 0.236 , 0.382, 0.500, 0.618, 0.764
max_entry=0.236, 0.382, 0.500, 0.618, 0.764, 1.000
#jakis komentarz
rsi_confirm= 25,27,30, 32
slope3 = 0.236, 0.382, 0.5, 0.764
min_tp=0.0125 , 0.0236, 0.0382, 0.05, 0.0764, 0.1
interval = 14
[thresholds]
low = 40
high = 40
persistence = 9
My match pattern:
my @match = $string =~ /(([\d-\.]+[, ]+)+[\d-\.]+)/sg;
print Dumper \@match;
My results:
$VAR1 = [
'-0.236, 0, 0.236 , 0.382, 0.500, 0.618, 0.764',
'0.618, ',
'0.236, 0.382, 0.500, 0.618, 0.764, 1.000',
'0.764, ',
'25,27,30, 32',
'30, ',
'0.236, 0.382, 0.5, 0.764',
'0.5, ',
'0.0125 , 0.0236, 0.0382, 0.05, 0.0764, 0.1',
'0.0764, '
];
I dont know why or how elemens with index 1( value '0.618, ',), 3 (value '0.764, ',), 5, 7, 9 are added with my regex. But I dont need it.
Result I would like to achieve:
print Dumper \@match;
$VAR1 = [
'-0.236, 0, 0.236 , 0.382, 0.500, 0.618, 0.764',
'0.236, 0.382, 0.500, 0.618, 0.764, 1.000',
'25,27,30, 32',
'0.236, 0.382, 0.5, 0.764',
'0.0125 , 0.0236, 0.0382, 0.05, 0.0764, 0.1',
]
Answer please base on my regex. The only repeating string identifying characters are "=" or "= " (before pattern) and "," (in the middle of the pattern)