I understand that you can find the complement of a character set. For example, the pattern [^abc]+ will find all characters that are neither "a" nor "b" nor "c".
I'm wondering if or how it's possible to find the complement of a sequence, such that unlike above, I could match all characters that are not the literal sequence "abc" instead of matching everything that's not the character "a" or "b" or "c".
If this is still confusing, this is essentially what I'm trying to do and what kind of result I expect:
local text = "Hello, world! Wonderful day, isn't it?"
for a in string.gmatch(text, "Complement of 'day'") do
print(a)
end
-- Output ->
-- Hello, world! Wonderful
-- Isn't it?
I hope this makes my question clear. Please let me know if you need more clarification.

4 comments
i think string.split may be what you want https://developer.roblox.com/en-us/api-reference/lua-docs/string/ you may be aware of it but im leaving this here just in case
You kind of start to not make sense here: "... such that unlike above, I could match all characters that are not the literal sequence "abc" instead of matching everything that's not the character "a" or "b" or "c"." Can you clarify what you meant?.
The closest solution for your preferred method is by using Frontier pattern matching. I will post an example after I come back home.
@incap I'm not really sure how else to phrase it. I'm essentially just trying to match all characters that are not in a given sequence. For example, if I wanted to ignore "Wo" in "Hello, World!", the expected result should be "Hello, " \n "rld!"