in reply to Matching Text Regular Expression.
It works better like this
the m modifier means match ^ to the beginning of any line, not just the string. So it matches a single quote at the front of a line and captures all characters after it that are not a pipe or a single quote.my @cities = $test =~ m/^'([^'|]+)/gm;
|
|---|