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
|
|---|