Is it possible to exclude parts of regular expression matches? Take this scenario as an example:
FREE SOFT FOUNDATION V2 1989 PAGE 2
STALLMANWORKS 2000 1977;PAGE 2
THE GNU PAGE 3 1977
I'm trying to match just FREE SOFT FOUNDATION
, STALLMANWORKS 2000
and THE GNU
. That's easy, but now I have to exclude any combination of [0-9;]+\s?(PAGE)
that comes after the title. I tried a negative lookahead, but had no luck:
(?!([0-9]+\s?(PAGE)))([A-Z0-9\s]+)