Page 1 of 1

How to capture this?

Posted: Fri Nov 30, 2018 3:24 am
by Vooku
I want to capture each 'name' returned in this format...

Katumi tells you '@Vooku: name1, name2, name3, name4, name5, name6, name7, name8,
name9,'

Might have a few lines of wrap-around text if that matters.

Thanks!

Re: How to capture this?

Posted: Sat Dec 15, 2018 6:11 pm
by Belgarath
You'll use a regex pattern like this: ^Katumi tells you '@Vooku: (.+)'$

And you'll parse it into a table.
Code: [show] | [select all] lua
names = matches[2]:split(', ')

Re: How to capture this?

Posted: Wed Dec 19, 2018 1:29 pm
by Vooku
Thanks much! How do display or see the contents of this table? How do I then delete the contents?

Re: How to capture this?

Posted: Fri Dec 21, 2018 8:43 am
by Belgarath
Vooku wrote:
Wed Dec 19, 2018 1:29 pm
Thanks much! How do display or see the contents of this table? How do I then delete the contents?
The wiki has some good documentation on this: https://wiki.mudlet.org/w/Manual:Table_Functions