I'm trying to solve this regex problem:
String:
"notme notme <P abc>getme1</P> notme notme <P dfg>getme2</P> notme notme"
Want this:
"getme1 getme2"
This regex solves it if the <P> does not contain more text
"(?<=<P>)(.|\n)*?(?=</P>)"
If I write it like this, I get an error in the lookback:
"(?<=<P.*?>)(.|\n)*?(?=</P>)"
Appreciate every contribution!
Best regards
M
).+?(?=\\<)", x, perl = TRUE ) )`
– Wimpel Nov 08 '21 at 10:53]*>(.*?)
")`. Base R: `regmatches(x, gregexpr("(?s)]*>\\K.*?(?=
)", x, perl=TRUE))`. See [this answer](https://stackoverflow.com/a/39086448/3832970). – Wiktor Stribiżew Nov 08 '21 at 10:58