Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: regular expression

by tobyink (Abbot)
on Jun 28, 2013 at 11:16 UTC ( #1041222=note: print w/replies, xml ) Need Help??


in reply to regular expression

#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $input = 'chr1:4775792-4775851'; my @numbers = ($input =~ /\b[0-9]+\b/g); print Dumper \@numbers;
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^2: regular expression
by Anonymous Monk on Jun 28, 2013 at 11:18 UTC
    what if there is a comma in the file itself

      Which file?

      Nobody said nothin' 'bout no file!

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
        the text file

      Files are natural habitats for commata and they will not suffer any harm!



      what if there is a comma in the file itself

      what if we did not know what to do with the comma, is it supposed to be part of the number?
      Or even something dividing numbers?

      Cheers, Sören

      (hooked on the Perl Programming language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041222]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2018-01-16 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (180 votes). Check out past polls.

    Notices?