Author Topic: Where can * be used as a wildcard?  (Read 828 times)

And just how wild is it?
if I put
A*D, will it work on ABCD or just ABD?

the two instances I know of are export() and something with file searching like findfirstfile() findnextfile() or something
give an example of where you plan on using it and I'll let you know

generally it can represent any number of characters.

I don't really have an example yet.
I was just looking for a reference

It's really quite useless in Blockland. As Nexus said, it's really only usable with files.

As Nexus said, the star could represent any number of one or more characters. All of the following would fall under A*D:

AD
ABD
ABCD
« Last Edit: May 09, 2012, 11:07:58 PM by TheRealMint »

The following functions accept wildcards for at minimum one of their parameters (I'm unsure of items in italics):
discoverFile
findFirstFile
findNextFile
export
deleteVariables

As Nexus said, the star could represent any number of characters. All of the following would fall under A*D:

AD
ABD
ABCD

That depends on the expression language. Actually I believe that the one TorqueScript is using would not classify "AD" under the expression "A*D*".

deleteVariables("$blah*");
That would delete any global variables starting with blah.

deleteVariables("$blah*");
That would delete any global variables starting with blah.
However, a variable named $blah would not be deleted..

$blah = "hi";
$blah::stuff = "hey";
$blah::test = "hello";

deleteVariables("$blah*");

$blah::stuff and $blah::test have now been deleted, but $blah still exists.

However, a variable named $blah would not be deleted..

$blah = "hi";
$blah::stuff = "hey";
$blah::test = "hello";

deleteVariables("$blah*");

$blah::stuff and $blah::test have now been deleted, but $blah still exists.
I said Starting with, not starting AND ending with.

I know you know, I was just clarifying for Lugnut.

http://forum.blockland.us/index.php?topic=177446.0

Specifically strMatch and striMatch from libstr.cs; they allow pattern matching with wildcards. (Also striReplace, case-insensitive strReplace which for some reason does not exist by default)

The strMatch functions don't support capturing though, might add that later.