Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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


Comment on Re: regular expression
Download Code
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

      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)

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



Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041222]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2014-07-31 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls