in reply to Re^2: Parsing/manipulating CSV files
in thread Parsing/manipulating CSV files

I'm not clear what you mean about the regex's.
They tend to be portable to different locale's (well, within reason ...). For example:
\d - matches 0 .. 9 (\d+) - means match at least 1 digit, could be more. [^ ] - means don't match space \S - Another way to match something that isn't a space
And so on are universal. It is a vast area and easy to get lost in. But absolutely invaluable for data parsing. Baby steps and you will indeed get there! OK - so the postcode isn't in a predictable place. I assume it is in a predictable format that won't match anything else in a record?
e.g 2 upper case chars, followed by 3 digits and 2 further upper case chars. Then your regex:
$line =~ /,?([A-Z]{3}\d{2}[A-Z]),/;
The ',?' bit means maybe match a comma ahead of the postcode. This is to catch the case that the pc is at the start of the record.
$1 will contain your postcode.
If you pass me the format I'd be happy to provide a suitable regex.