How to capture this?

Post Reply
Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

How to capture this?

Post by Vooku » Fri Nov 30, 2018 3:24 am

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!

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#2283

Re: How to capture this?

Post by Belgarath » Sat Dec 15, 2018 6:11 pm

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(', ')

Vooku
Posts: 72
Joined: Sun Aug 21, 2016 2:42 pm

Re: How to capture this?

Post by Vooku » 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?

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#2283

Re: How to capture this?

Post by Belgarath » Fri Dec 21, 2018 8:43 am

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

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests