Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


lua match until word?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Sun Sep 26, 2021 6:07 am    Post subject: lua match until word? Reply with quote

how can i do a lua match until word like in regex? is it possible?
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Sun Sep 26, 2021 6:28 am    Post subject: Reply with quote

You have a few options available:
Quote:

• find(string, pattern [, init [, plain]]): This function returns to start and end index of a match pattern in a string.
• match(string, pattern [, index]): This function matches a pattern once the matching starts at the given index.
• gmatch(string, pattern): This function returns a function which iterates through all matches pattern in string.
• gsub(string, pattern, repl [, n]): This function is used to replace the matched string by substrings and n-specify the number of replacements.


Rules:
Quote:

• .– : This is a pattern which matches all characters.
• %a: This is a special sequence which matches all letters.
• %l: This is a special sequence which matches all lowercase letters.
• %u: This is a special sequence which matches all uppercase letters.
• %d: This is a special sequence which matches all digits.
• %s: This is a special sequence which matches all whitespace characters.
• %x: This is a special sequence which matches all hexadecimal digits.
• %p: This is a special sequence which matches all punctuation characters.
• %g: This is a special sequence which matches all printable characters except space.
• %c: This is a special sequence which matches all control characters.
• [set]: This is a set which matches the class which is the union of all characters in set.
• [^set]: This is a special sequence which matches the complement of set.
• +: This is a greedy match which matches 1 or more occurrences of previous character class.
• *: This is a greedy match which matches 0 or more occurrences of previous character class.
• ?: This is a match exactly which matches 0 or 1 occurrence of previous character class.
• – -: This is a lazy match which matched 0 or more occurrences of previous character class.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites