(?i)^\s*searchnews(?: ([a-zA-Z]+))(?: ([ASB]))?(?: ([0-9]+))?(.+)
-- -- Author: Malaphus -- -- Settings: local searchHighlightColor = "yellow" -- END Settings. Don't edit things below this line unless you know how to not break stuff. lastNewsSearch = matches[5]:trim():lower() if matches[2] == "clear" and lastNewsSearch == "highlight" then if newsHighlightTrigger then cecho("Searchnews highlight has been cleared.\n") killTrigger(newsHighlightTrigger) newsHighlightTrigger = nil else cecho("Searchnews highlight has was not set.\n") end send("\n", false) return end newsHighlightFunction = newsHighlightFunction or function (term, color) local c, k = 1, 1 while k > 0 do k = line:lower():find(term, k) if k == nil then return end c = c + 1 from, how_long = line:lower():find("%f[%a]"..term.."%f[%A]", k) if from then if selectSection(k-1, how_long - k + 1) then fg(color) resetFormat() else return end end k = from + 1 end end if newsHighlightTrigger then killTrigger(newsHighlightTrigger) newsHighlightTrigger = nil end newsHighlightTrigger = tempRegexTrigger("(?i:" .. lastNewsSearch .. ")", ([[newsHighlightFunction("%s", "%s")]]):format(lastNewsSearch, searchHighlightColor)) send(matches[1], false) cecho("\nSearch Term: <" .. searchHighlightColor .. ">" .. lastNewsSearch .. "\n\nSearch Results:\n\n")
Comments
Thanks!
Have to put two spaces after the news section I'm looking in;
searchnews announce bullet
searchnews announce bullet