I have the following regex:
my $scores_compiled_regex = qr{^0
\s+
(\p{Alpha}+\d*)
\s+
(\d+
\s*
\p{Alpha}*)
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s{2,}
(\d+)?
\s+
\d+ #$
}xos
;
It should match lines like these (from a plain txt file):
0 AAS 211 1 1 5 2 6 15
While the column names are:
0 INST, NAME A A- B+ B B- C+ C C- D+ D D- F CR P PR I I* W WP WF AU NR FN FS
and it means: Score A=1, Score A- = 1, No Score B+, Score B=5 , etc.. I'm trying to split it to an list, and not ignoring empty columns, it works, but very slow, also the matching is very slow, and by slow I mean, more than 5 seconds, sometimes even more!
The First few files in the file looks like:
0 PALMER, JAN A A- B+ B B- C+ C C- D+ D D- F CR P PR I I* W WP WF AU NR FN FS TOTAL
0 ECON 103 98 35 114 1 14 75 9 35 1 10 1
The Scores are anything that follows the A column to the right.
any idea? Thanks,