I
Isaac Councill
Hello,
I am trying to extract capitalized words from text that are not the
first words in a sentence. I thought it would be straightforward
using negative lookbehind for periods:
m/((??<!\. )|(?<!\. ))[A-Z][a-z]+)/g
but not the case.
The above regexp will match all capitalized words not preceded by one
or two spaces. For instance, if I use a lookbehind with \. followed
by one space, I get no results unless there are capitalized words not
preceded by a space (e.g. "(Something" - I can extract "Something").
It seems that the matcher is simply ignoring the "\.". What am I
missing here?
Thanks,
Isaac
I am trying to extract capitalized words from text that are not the
first words in a sentence. I thought it would be straightforward
using negative lookbehind for periods:
m/((??<!\. )|(?<!\. ))[A-Z][a-z]+)/g
but not the case.
The above regexp will match all capitalized words not preceded by one
or two spaces. For instance, if I use a lookbehind with \. followed
by one space, I get no results unless there are capitalized words not
preceded by a space (e.g. "(Something" - I can extract "Something").
It seems that the matcher is simply ignoring the "\.". What am I
missing here?
Thanks,
Isaac