I am looking for the most elegant way to make it out. I just click on the wall when it comes to my meaning of regular expressions, and maybe regular expression is not even the best answer?
I have three example sentences to give an example of what I want to do. I want to make them into four parts. Attacker, type of attack, damage and target.
Gandalfs heavenly wrath KILLS you!
The Holy Prelate cuts through Frodo's wounds.
Your divine power destroys the evil Warlock!
Attacker: One or more words that are always first, and words can be identified by either "Your" or end in s.
Type of attack: one or more words that can only be identified by the fact that they are between โattackerโ and โdamageโ.
Damage: one or more (rare, but existing) words that are unique and limited. I have a list of possible words. {"wounds", "destroyed", etc.}. They do not exist anywhere, so they do not risk that the attacker is called "wounds" or something like that.
Purpose: one or more words that can be identified that they are all words after damage.
source
share