in reply to Matching Text Regular Expression.

Close. What you have obviously works, but isn't quite what you want. At least, not precisely.

my @cities = $test =~ m/'(.*?)[|']/g;
Inside a character class (the stuff in the square brackets, []), the | doesn't have a special meaning as it does outside. So you don't need to escape it. Because the character class is always a "this character OR this character OR ..." set, you don't need a special character for "OR" - it's implied. And thus we have the two characters we're looking for as a termination: | and '.

Good luck!