Search found 190 matches

by Yetzederixx
Mon May 02, 2011 4:36 am
Forum: Help Forum
Topic: Need help pattern matching
Replies: 14
Views: 2346

Re: Need help pattern matching

^\s+([\w-]+)\s+([\w-]+)\s+([\w-]+)$

Try that instead (\w covers everthing except the -). I'm not certain if you really want to capture the white space or not so I didn't bother surrounding it with (), change as necessary. Also, check the end of line and adjust or remove the $ as necessary.
by Yetzederixx
Mon Apr 25, 2011 7:43 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

so the odds in the above post are all basically matches[1] and the evens are matches[2]? If so that should definitely get into the manual somewhere, unless I missed it of course.
by Yetzederixx
Mon Apr 25, 2011 6:01 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

by changing a line to add in the string.gsub() fn it's fixed!!!!
Code: [show] | [select all] lua
local isClanner, clan = getIndex(string.gsub(matches[i], "'s$", ""))
by Yetzederixx
Mon Apr 25, 2011 5:40 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

Reading string.gsub() now, thanks for all your help. I didn't understand that it was returning more elements in the matches array.

Any idea why it's doubling up in the matches table though?
by Yetzederixx
Sun Apr 24, 2011 9:40 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

Alright, aside from how to capture a name in the plural (my MUD allows single quotes in player names) I've got it to work with a single regex. Regex: ([A-Z]'{0,1}[a-zA-Z]+'{0,1}[a-zA-Z]+) local i = 2 while i <= #matches do local isClanner, clan = getIndex(matches[i]) -- personal fn to see if they're...
by Yetzederixx
Sun Apr 24, 2011 8:34 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

Ok, got this far with some experimenting. Reduced it to a single regex again and then just display(matches) to see what I got. Diamante Ka'tath walks in. table { 1: 'Diamante' 2: 'Diamante' 3: 'Ka'tath' 4: 'Ka'tath' } I can probably use similar code to what I already have just put it into a loop to ...
by Yetzederixx
Sun Apr 24, 2011 8:19 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

I've had it checked through the entire process. From what I could find of the /g option it returns an array, table in lua I'd imagine, so do I access it matches[2], matches[3], etc or is it in a multimatches? Guess that's where I'm confused.
by Yetzederixx
Sun Apr 24, 2011 6:55 pm
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

I did change it to two triggers, one for beginning of line and one for end of line, I just wanted to do it with one is all.

Then I have no clue what the match all thing is and/or is for evidently.
by Yetzederixx
Sun Apr 24, 2011 5:34 am
Forum: Whatever
Topic: For some reason it makes most sense...
Replies: 1
Views: 1086

Re: For some reason it makes most sense...

I found myself writing my cause and effect paper's outline in pseudo-code also.
by Yetzederixx
Sun Apr 24, 2011 5:30 am
Forum: Help Forum
Topic: Multiple matches on a single line
Replies: 20
Views: 3166

Re: Multiple matches on a single line

What I don't want to do is change the pattern to ^.*$ and then parse each line for names and then try to figure out how to either replace the names in color or rebuild each and every line with cecho. It seems that the match all checkbox is basically doing nothing as it doesn't matter if it's checked...