Open theludovyc opened 2 years ago
For now, I don't know how to detect match are in string with regex
For now, I don't know how to detect match are in string with regex
I'm not sure what you mean by this @theludovyc , can you elaborate on this topic ?
I don't know how to resolve this bug for now. I need to learn more about regex. If you or other already know how to solve it with regex, feel free to help :)
I want try to help you @theludovyc , but I'm not sure what you mean by , can you give example or something ?
For now, I don't know how to detect match are in string with regex
For JumpIf I use Expression class. To dectect used variables I use this regex
VARIABLE = "((?<char_tag>{NAME})\\.)?(?<var_name>{NAME})"
You can write something like that
jump todo if test.name = "Test character"
When I use VARIABLE on test.name = "Test character" it return 3 match, test.name, Test and character.
First one is good but I don't want Test and character because they are in String.
So I need to update my regex and check if match are not in String.
jump todo if test.name = "Test character" When I use VARIABLE on test.name = "Test character" it return 3 match, test.name, Test and character. First one is good but I don't want Test and character because it is in String. So I need to update my regex and check if match are not in String.
O I see you just want to catch string in regex.
I went to Godot Dialogue Manger repo from which I borrow regex approuch,
and there found this line: DialogueConstants.TOKEN_STRING: "^\".*?\"",
- this regex should to it.
First one is good but I don't want Test and character because they are in String. O I see you just want to catch string in regex.
No, the opposite. I want to catch regex if they aren't in String.
I try a bit of experiment on regex.com and found this solution: regexr.com/6nke5 ,
but you still need to check in code if string don't starts from "
In "Test character" return Test.