Except, it doesn't. All it does right now is highlight the captured matches. It will match/capture the first 3 lines, and show that in highlight.
So, the lines starting with Class, ---- and Mage get highlighted, but Cleric, Thief, Warrior and Necromancer, do not.
Regex issue matching.
Re: Regex issue matching.
This is why you should not post at 6am. Sorry for that.
Personally, I would use this pattern. (Tested and confirmed working).
Personally, I would use this pattern. (Tested and confirmed working).
Code: Select all
^(\w+)\s+(\d+)\s+(\d+)\/\s?(\d+)\s+(\d+)\s+\(\s?(\d+)\%\)$
Re: Regex issue matching.
Wait... so the class line is getting highlighted? It doesn't come even close to matching the pattern we gave... so you are probably mistakenly using a multiline trigger. If you turn that off, and get rid of your other patterns, you will see that all of the different classes are correctly captured by the trigger pattern.
-
- Posts: 26
- Joined: Sun Sep 01, 2013 11:08 pm
Re: Regex issue matching.
Well, I was going to ask why a multiline trigger would be a mistake, but then I simply did what Jor'mox suggested and now it captures it all.. Weird to me. Thank you all for the assistance.
Re: Regex issue matching.
A multiline trigger is a trigger that fires one time after all of the listed patterns are matched within the set number of lines. A regular trigger fires for each line that matches the pattern, so in this case, it will fire for all of the lines you are interested in. A multiline trigger would need to have a pattern for each of them, even though those patterns would be the same. And it would only work so long as it had just the right number of classes to get information on.
-
- Posts: 26
- Joined: Sun Sep 01, 2013 11:08 pm
Re: Regex issue matching.
Ah, alright. Thank you Jor'Mox. Now, how do I get the trigger to capture and send the info to the script so I can make use of the info?
Re: Regex issue matching.
Do you have a separate script, or just a small script inside the trigger?
A script inside the trigger would be well suited to doing the same thing to each line, as soon as you see it. A separate script (which would require you to create a function inside a script that your trigger would use to send your script information) would be better suited to doing something with all of the information at once.
If you had a separate script, you could do something like this inside the trigger:
A script inside the trigger would be well suited to doing the same thing to each line, as soon as you see it. A separate script (which would require you to create a function inside a script that your trigger would use to send your script information) would be better suited to doing something with all of the information at once.
If you had a separate script, you could do something like this inside the trigger:
And then something like this in a script to store everything:
Then you can make a second function to let you use the information that got stored in the classinfo table.
-
- Posts: 26
- Joined: Sun Sep 01, 2013 11:08 pm
Re: Regex issue matching.
Oh. Daunting to do a separate script for what basically will amount to using the info in a small trigger script. Thank you for the clarification. I see doing a script will be overkill for what I intend.