in reply to regex assistance
Thus @array=$string=~/PATTERN/g is the syntax you need.
The PATTERN is to capture a series of non space characters if they are followed by the ' - ' pattern.
If you need more help than that:
~/$ perl -e '$string=q(GAP_SPAN09 - GAP SPAN base (Scratch Testing [TS +MC11] : tsmc11_wld(sxfatd12j)) GAP_SPAN03 - GAP SPAN base (DFD E2E Te +sting [TSPAN04] : tspan04-dfdint-wld(sxfamd6f)) POS_WLI02 - POS_WLI02 + Web Logic Integrator);@array=$string=~m/(\S+)(?= - )/g;for $record_t +itle (@array){print "$record_title\n";}' GAP_SPAN09 GAP_SPAN03 POS_WLI02
|
|---|