in reply to [untitled node, ID 192753]
To gain performance I would use those non-backtracking subpatterns "(?> )"
.
From the Camels third edition (p.206):
"...if you're going to fail, it's best to fail quickly and get on with your life."
my @users; foreach (@site) { / ^ (?>\s*) <!-- (?>\s+) USER (?>\s+) (?>\d+) (?>\s+) - (?>\s+) (\S+ +?) (?>\s+) --> (?>\s*) $ /ix and push @users, $1; } print @users;
I've also specified the pattern as exactly as possible, because this will also fail earlier and thus speed up the engine.
|
|---|