Extract colored text from pattern

Post Reply
azure_glass
Posts: 97
Joined: Wed Jul 25, 2012 12:35 pm

Extract colored text from pattern

Post by azure_glass »

Hi there is a way to extract text from line to a var?

example:

[color= red]big ogre [/color] smashes [color= blue]tiny elf [/color] , with wooden club hinting his head.

pattern: (^(.*) (smashes|wounding) (.*)\.$)

Magic Code

My code: echo(matches[3] .. " ".. matches[4] .." ".. (matches[5]))

output:
[color= red]big ogre [/color] smashes [color= blue]tiny elf [/color]
English is not my native language. If you don't understand what im writing ask. :)
Ubuntu 17.04, Mudlet 3.1

Post Reply