Hello Harry,
I’m the one, who posted this reply to Clearinghouse Forsale, three months ago, about ! Refer to the link below :
https://notepad-plus-plus.org/community/topic/10848/need-some-help-with-find-and-replace/3
And indeed, reading again this old post, I just realize that I didn’t pay enough attention to the line :
now as you see, i have alot of lines that state begin…type tree…age ##### end
So, the replacement should occur, ONLY IF the lines contain the word Tree, before the word Age !
In that case, just change the search regex as :
Tree .* Age \K.+(?= END$)
REMARKS :
There a space, BEFORE and AFTER the words Tree and Age, and a space BEFORE the last word END !
I also added the $ symbol, to be sure that we search for the word END, at the very end of each line
NOTES :
This time, the search regex is looking, FIRST, for any text, in a same line, between a first occurrence of the word Tree and a last occurrence of the word Age ( Tree .* Age )
Due to the \K form, this previous match is, then, forgotten by the regex engine
Next, it tries to match a non empty list of characters (.+)
But, ONLY IF that list is followed with a space and the word END, which ends the current line ( (?= END$) ). So it selects the exact number, only, between the word Age and the keyword END !
Best Regards,
guy038