I'm completely new to regexps and syntax melts my brain, so basically i have a string which looks like this
randomtext WORD randomtext WORD neededtext BORDERWORD randomtext
Where word and borderword are different from each other, other stuff is self explanatory.
I've got as far as /(.?(WORD)){2}((.|\n)*)BORDERWORD/
but it doesn't work.
Another problem is that both randomtext and neededtext contain newline characters, which i think i solved in the matching group that tries to match neededtext ((.|\n)*)
but have no idea how to make it work in the first one.
Any help will be greatly appreciated.
Edit: figured out a workaround, first match word((.|\n)*)borderword
and then match the result with word((.|\n)*)
Done. Doesn't seem right but it works for my purposes.