Match non english caracters

So, I’m using string.gmatch to split my string, my pattern is [%w]+ for matching, but, I realized that it doesn’t match the non english caracters like ñ á and others, can somebody help me?

You can use [^%s]+ to split the string based on whitespace, in case that’s what you were looking for. There is no built in functionality for detecting whether a character is considered a “letter” that is Unicode-aware, so you’ll need to be more specific about what you’re trying to do.

Oh, it worked, thank you, haha.

1 Like