View Single Post
06/29/23, 10:46 PM   #14
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 660
The following table lists all character classes:

. all characters
%a letters
%c control characters
%d digits
%l lower case letters
%p punctuation characters
%s space characters
%u upper case letters
%w alphanumeric characters
%x hexadecimal digits
%z the character with representation 0

An upper case version of any of those classes represents the complement of the class. For instance, '%A' represents all non-letter characters
You can't search for only the answer you seek, just the uppercase S. If you read it and see that the lowercase s is a space then the uppercase is all non spaces.

Code:
  local searchByWords = zo_strgmatch(searchText, '%S+')
  for theWord in searchByWords do
    <<do stuff>>
  end
Which is why that would return 3 words if searchText was "The Zone Name" similar to splitting the string using a space for the split.

Last edited by Sharlikran : 06/30/23 at 12:13 AM.
  Reply With Quote