I have unstructured data in the following template:
'<http://www.wikidata.org/entity/Q1> <http://www.wikidata.org/entity/P31c> <http://www.wikidata.org/entity/Q1454986> .',
'<http://www.wikidata.org/entity/Q1> <http://www.wikidata.org/entity/P227c> "4079154-3" .',
'<http://www.wikidata.org/entity/Q1> <http://www.wikidata.org/entity/P373c> "Universe" .'
I want to extract the last element of each url and the result should look like this:
'Q1 P31c Q1454986',
'Q1 P227c 4079154-3',
'Q1 P373c Universe'
I already tried some examples including this and this. But, mostly they only have one link in a line.
I am still learning regular expressions and I am not able to solve the above.