I want to identify and extract all the words in a document that are followed by the register mark (®) symbol.
I built, what I thought was a regular expression that would search for a register mark preceeded by alpha number characters and a space. So if my text contained the sentence "My first car was a Chevrolet Vega®.", the regular expression would find "Vega®"
Below is the regular expression I composed. Wouldn't the \s restrict the search to characters with a register mark that are preceded by a whitespace character?
Instead, it grabs anything with a register mark, not just the register marks preceded by a space and alpha numeric characters.
Where did I go wrong?
\s[\w-®]
I built, what I thought was a regular expression that would search for a register mark preceeded by alpha number characters and a space. So if my text contained the sentence "My first car was a Chevrolet Vega®.", the regular expression would find "Vega®"
Below is the regular expression I composed. Wouldn't the \s restrict the search to characters with a register mark that are preceded by a whitespace character?
Instead, it grabs anything with a register mark, not just the register marks preceded by a space and alpha numeric characters.
Where did I go wrong?
\s[\w-®]