'Find second word based on position of first word in a string

I am trying to locate a word based on the position of a different word i.e.

second_word = "KEGG"
first_word_position = 35

How do I locate the position of my second word by looking near the position of my first word. The reason for this being there are many duplicates of my second word that I am looking for, but only a single value for the first word I have located. The purpose of this being to parse through a webpage and locate annotation date for specific reactions.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source