Jump to content

match function does not work


photo

Recommended Posts

Hi, 

int match(string pattern, string str) function does not seem to work, i wonder if it's not implemented or i have used it in a wrong way.

string testString = "denemedeneme";
int check = match("mede", testString);
log.message("string match test: %i\n", check);

returns 0. So does code with

int check = match("asd", testString);

What am i missing here?

Link to comment

Hi!

 

There is indeed some wrong behavior in match() function. I've added ticket to our internal bug tracker.

 

In your case I would suggest to use strstr() function:

string test_string = "denemedeneme";

if (strstr(test_string, "mede") != -1) {
	log.message("found");
}

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • 2 years later...
×
×
  • Create New...