<triggers>
  <trigger
   enabled="y"
   group="clothesline"
   keep_evaluating="y"
   match="^(He|She) is (.+) (He|She) is wearing (.+)$"
   name="clothesline"
   omit_from_output="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>local data = "%0"
local gender = "%1"

local clothindex = string.find(data, "is wearing")
local description = string.sub(data, 1, clothindex - 2)
local reversed = string.reverse(description)
local lastperiod = string.find(reversed, "%.")
local description = string.sub(description, 1, string.len(description) - lastperiod + 1)

local clothes = string.sub(data, clothindex, string.len(data))
local lastperiod = string.find(clothes, "%.")
local clothes = string.sub(clothes, 1, lastperiod)
local clothes = gender .. " " .. clothes

local clothindex = string.find(data, clothes)
if clothindex then
  description = description .. string.sub(data, clothindex + string.len(clothes), string.len(data))
end

local clothes = string.gsub(clothes, "is wearing", "is wearing:\\n")
local clothes = string.gsub(clothes, ",", ",\\n")

ColourNote("lightgrey", "", description)
ColourNote("lightgrey", "", clothes)</send>
  </trigger>
</triggers>
