Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: splitting a string on pre-defined tags

by jimpudar (Pilgrim)
on May 22, 2018 at 20:43 UTC ( [id://1215069]=note: print w/replies, xml ) Need Help??


in reply to Re: splitting a string on pre-defined tags
in thread splitting a string on pre-defined tags

You beat me to it!

use strict; use warnings; use 5.10.0; my $string="C*ID1*Mac*C release for EA's D*ID1*Spore1 game*D; D*ID1*Sp +ore 1*D is better than D*ID2*Spore 2 game*D."; my @fields; while ($string =~ /([A-Z])\* # A single capital letter followed by s +tar ID\d+\* # String 'ID' followed by a number and +a star .*? # Anything \*\1 # A star followed by the original singl +e capital letter /gx) { push @fields, $&; }

Jim

Log In?
Username:
Password:

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

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

    No recent polls found