View Full Version : match / gmatch wildcards + variables

10 October 2006, 10:29 PM
hey everyone,
i'm writing a script that will read another text file as a source for selecting lots of different stuff, and i'm currently hitting a roadblock and was hoping to get some advice from the much better mel scripters here...

currently i'm using gmatch to test whether a line matches a category, and then add the following line to a string variable. the problem i'm having is that the matching line is a variable, and i want to use wildcards with the gmatch, but i can't figure out how to use them successfully with a variable.

gmatch "matches" "m*s";
// Result: 1 //

but in this example, how could i use the following not-working pseudocode...

string $test = "match"
gmatch "matches" $test + "*" get another successful result: 1?

thanks a lot

10 October 2006, 10:58 PM
string $test = "match";
print (`gmatch "matches" ($test + "*")`);


10 October 2006, 11:08 PM

well that's simple enough.

thank you!

CGTalk Moderation
10 October 2006, 11:08 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.