Aussie Susan:Try a matching pattern of:
(AUTHOR:\s*)([^\r\n]*)([\S\s]+)\*review\s+by\s+([^~]*)
and replacement text of
$1$4$3$4
with the 'ignore case' option set (or the text altered to suit). You don't mention the regex/language tht you are using, to the replaecment text may need to be "\1\4\3\4" or whatever is appropriate.
Susan
PS: Only tested with the single example you provided and making assumptions about there never being a "*review by" within the text before the one you are after.
Hi Susan, thank you for the quick reply. This is very close to exactly what I need, just a couple tweaks and I think we'll have it.
I'm working with a text processor which supports the PCRE library so the "\1\4\3\4" replace format was the one that worked.
Your assumption that "*review by" never occurs within the text before the one I'm after is partially correct. My fault for not being more clear:
"*review by" isn't a constant, what I meant is "*(some wildcard text) by "
i.e. "*by", "*review by", "*a review by", "*an essay by", etc. would all be valid delimiters. If it helps, another thing to note is that this match will always be from within the block of text that begins with <!-- BIO>.
update:
After some experimentation, I got it working by using
*[\S\s]*?\s*?by
instead of
*review\s+by
like this:
(AUTHOR:\s*)([^\r\n]*)([\S\s]+)\*[\S\s]*?\s*?by\s+([^~]*)
So now the only tweak is after running the expression, the string "*review by" is getting deleted in the result. This text needs to remain unaffected. Any thoughts?
Thanks again!
best,
--dhl