So, I am making a luau syntax highlighter using RichText and gsub.
Works well, but when another word is in another, they interfere.
Example: local inside = "hi"
The “in” in “inside” is flagged as something that needs to be highlighted, and I only want it to be highlighted if It’s by itself.
Use regex to match the start and end of strings in Lua, that would be the characters ^ to represent the start of a string of characters and $ to match the end of a string of characters.
Regex is short for regular expressions, an advanced pattern matching system. There are resources online for it, and you will need to learn it to have any hope of making syntax highlighting.