Dear Monks,
I would like a regex that will pick out a string that does not contain a comma except where ", City of" or ", County of" is present.
I tried the following:
if ( $_ =~
m/^([^,]+),([^,|,\sCity\sof|,\sCounty\sof]+),[\d|\.]+,[\d|\.]+,
+[\d|\.]+,[\d|\.]+,,[\d|\.]+,[\d|\.]+,[\d|\.]+,[\d|\.]+,,[\d|\.]+,[\d|
+\.]+,[\d|\.]+,[\d|\.]+/
)
{
without luck. Any help appreciated.
Update: I am working with a CSV file. However I am not sure if the CSV modules suggested below would get around the problem of commas existing where they shouldn't.