in reply to Re^2: regex assistance
in thread regex assistance
use strict; use warnings; my @records=('GAP_SPAN09 - GAP SPAN base (Scratch Testing [TSMC11] : t +smc11_wld(sxfatd12j))', 'GAP_SPAN03 - GAP SPAN base (DFD E2E Testing [TSPAN04] : tspan04-d +fdint-wld(sxfamd6f))', 'POS_WLI02 - POS_WLI02 Web Logic Integrator)'); my @record_ids; for my $record (@records){ $record=~m/^(\S+)(?= - )/g; push @record_ids , $1; } for my $record_id (@record_ids){ print "$record_id\n"; } __END__ GAP_SPAN09 GAP_SPAN03 POS_WLI02
|
|---|