Hi, @shadowfire-omega and All,
Hope you don’t mind my late reply ! So, given the 8 lines "aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+", which end, each, with a word, after the = separator sign
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Appraise
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Bluff
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Concentration
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Test
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Shadowfire
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=Omega
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=OK
"aAppraise|0|Appraise "+Appraise+"/"eval(+mAppraise+)" "+cAppraise+"=The End
and the regex S/R :
SEARCH (?-is)Appraise(?=.+=(.+))|=.+
REPLACE ?1\1
First, the (?-is) forces the regex search to be sensitive ( non-insensitive !) to the case and the dot . regex character to represents any single standard character and not an End of Line character
Then it matches any of the two alternatives, giving priority to the first one
The regex (?-is)Appraise(?=.+=(.+))
The regex =.+
If the first alternative is chosen, it, then, matches the Appraise string but only if the look-ahead feature is verified. That is to say if there is, further on, in the same line, a = sign, followed by some standard characters, which ends the current line. As this condition is, by construction, always true, the part after the = sign is, thus, stored as group 1
As soon as the = location is reached, by the regex engine, no more = sign can be found, afterwards. So, the first alternative cannot be matched, anymore, in current line !
But, now, the second alternative =.+ matches all the end of line, beginning with the = sign
In replacement, ?1\1 is a conditional structure, which means :
If group 1 exists, we replace the string Appraise with the contents of group 1
If group 1 does not exist, we do not rewrite anything. So, the range of characters beginning with the = sign till the end of current line, is deleted
Et voilà !
Cheers
guy038