Hi, Tiago!

I can't reproduce such behaviour

use Modern::Perl '2014';
my $string = 'Crosses   misses=50               ';
my (@matches) = ($string =~ /(Crosses)(.*)(misses=)(\d+)/s);

use Data::Dumper;
print Dumper \@matches;

result:
$VAR1 = [
          'Crosses',
          '     ',
          'misses=',
          '50'
        ];

As you see, no tabs in $matches[3];

Please, publish string that you try to parse with this regexp.


чт, 18 июня 2015 г. в 16:24, Tiago Hori <tiago.h...@gmail.com>:

> Folks,
>
> I have the following regex: $_ =~ /(Crosses)(.*)(misses=)(\d+)/s
>
> It does what I need to do in terms of matching, but I also want to use the
> capture parenthesis. The data comes from tab-limited files and I use $4 to
> grab the last digits of the match, however it is also matching the trailing
> tab. I solved it by stripping of the tabs from the line, but I can figure
> out why (\d+) is also matching the tab!
>
> T.
>
> --
> "Education is not to be used to promote obscurantism." - Theodonius
> Dobzhansky.
>
> "Gracias a la vida que me ha dado tanto
> Me ha dado el sonido y el abecedario
> Con él, las palabras que pienso y declaro
> Madre, amigo, hermano
> Y luz alumbrando la ruta del alma del que estoy amando
>
> Gracias a la vida que me ha dado tanto
> Me ha dado la marcha de mis pies cansados
> Con ellos anduve ciudades y charcos
> Playas y desiertos, montañas y llanos
> Y la casa tuya, tu calle y tu patio"
>
> Violeta Parra - Gracias a la Vida
>
> Tiago S. F. Hori. PhD.
> Ocean Science Center-Memorial University of Newfoundland
>

Reply via email to