Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (120 points)
recategorized by

I want to reconstruct a table of contents using the package stringr in R to capture the pattern of all headlines. The raw headlines look like this:

r\nPart I The Federal Government’s objectives and priorities in the area\r\n of research and innovation policy 7

\r\nPart II The German research and innovation system 55

\r\nPart III The Federal Government’s research and innovation policy 95

\r\nPart IV International cooperation in research and innovation 103

I would like to have a pattern using regular expressions that looks like this: "Part" + Roman numerals + clean text of headline + page number

Could someone please help me with this regular expression?

Thank you so much!

Please log in or register to answer this question.

Browse Categories

...