I'm new to this and probably doing something stupid... but here goes...
I have a trigger in my world file that calls rex:match in the send to script section. The pattern is not matching there, but if I use the same pattern (and test text) in the immediate window then it matches.
Trigger pattern: ^God tells you: "do (?<order>.+)"$
regular expression is checked
send to script is selected
send:
re = rex.new([[^(t|te|tel|tell)\s+(\S+)\s+do\s+(.+)$]])
s,e,t = re:match("%<order>")
print("%<order>")
print(s,e,t)
When I test the trigger, I get the following output:
God tells you: "do tell me do kill"
tell me do kill
nil nil nil
However, if I put the following script into the immediate window:
re = rex.new([[^(t|te|tel|tell)\s+(\S+)\s+do\s+(.+)$]])
s,e,t = re:match("tell me do kill")
print(s,e,t)
I get the following output:
1 15 table: 03B09530
Why is it matching in one place and not the other?
Thanks :)
I have a trigger in my world file that calls rex:match in the send to script section. The pattern is not matching there, but if I use the same pattern (and test text) in the immediate window then it matches.
Trigger pattern: ^God tells you: "do (?<order>.+)"$
regular expression is checked
send to script is selected
send:
re = rex.new([[^(t|te|tel|tell)\s+(\S+)\s+do\s+(.+)$]])
s,e,t = re:match("%<order>")
print("%<order>")
print(s,e,t)
When I test the trigger, I get the following output:
God tells you: "do tell me do kill"
tell me do kill
nil nil nil
However, if I put the following script into the immediate window:
re = rex.new([[^(t|te|tel|tell)\s+(\S+)\s+do\s+(.+)$]])
s,e,t = re:match("tell me do kill")
print(s,e,t)
I get the following output:
1 15 table: 03B09530
Why is it matching in one place and not the other?
Thanks :)