How can we print a substring that occurs between two patterns? We are also provided an offset of a character in the string as an input to choose which substring needs to be printed.
E.g.
string = '<p class="one">A quick brown fox</p><p class="two">Jumps over</p>'
The substring that needs to be printed is between the patterns ">
and </p>
.
If the offset provided is 20
then A quick brown fox
should be printed.
If the offset provided is 55
then Jumps over
should be printed, this offset should be received as an input.