How does string.match work? The wiki says it returns whatever is matched, but when I run it in the lua demo, I get nothing.

Post the code you ran.

string.match("This is a test", "(test)")

It works fine for me.

What does it return for you?

I hope you were using print.

print( string.match( "This is a test", "(test)" ) )

Prints the word test.