Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: regex for multiple capture within boundary

by ikegami (Patriarch)
on Jul 14, 2006 at 19:57 UTC ( [id://561313]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @nums = $x =~ /(\S+)/g;
    
  2. or download this
    my @nums = split(' ', $x);
    
  3. or download this
    # @nums = ('1', '11', '2', '22', '222', '3', '33');
    my @nums = $x =~ /(\d+)/g;
    
  4. or download this
    # @nums = (['1', '11'], ['2', '22', '222'], ['3', '33']);
    my @nums = map { [ /(\d+)/g ] } $x =~ /(\S+)/g;
    
  5. or download this
    # @nums = ('2', '22', '222');
    my @nums = ($x =~ /\s(\S+)/)[0] =~ /(\d+)/g;
    
  6. or download this
    # @nums = ('2', '22', '222');
    my @nums = (split(' ', $x, 3))[1] =~ /(\d+)/g;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found