in reply to Regex Help!
A small example under the Perl debugger, storing the countries into a @locations array:
DB<16> p $loc_data Location: England Location: Scotland Location: Finland DB<17> @locations = $loc_data =~ /Location: ([^\n]+)/g; DB<18> x @locations 0 'England' 1 'Scotland' 2 'Finland'
The regex used assumes that the record separator is '\n', it might need to be adapted.
|
|---|