Regex Issues - Check this out - Is Mudlet broke?

Post Reply
noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Regex Issues - Check this out - Is Mudlet broke?

Post by noblestone »

Trigger for PromptConsole
Code: [show] | [select all] lua
[(\d+):(\d+)][(\d+):(\d+)][(\d+):(\d+)][(\d+)][(\d+):(\d+)][Kills:(\d+)][XP:(\d+)]
perl regen enabled.

[3961:4008][5403:6682][4284:4284][7105][-:-][Kills:226][XP:51848] <--- this worked into my prompt console on Geyser UI

However this wont...

[596:596][112:112][478:492][2840][-:-][Kills:226][XP:51848] <--- notice 3 digits instead of four digits.

I have ran http://rubular.com/ and tested , first part matches with regex, second part came out, not matched. What is going on? Always thought (\d+) captures any digits?

Thanks

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: Regex Issues - Check this out - Is Mudlet broke?

Post by Belgarath »

This should match fine:

^\[(\d+):(\d+)\]\[(\d+):(\d+)\]\[(\d+):(\d+)\]\[(\d+)\]\[-:-\]\[Kills:(\d+)\]\[XP:(\d+)\]$

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex Issues - Check this out - Is Mudlet broke?

Post by noblestone »

That above code didn't solve the problem. *mutter*

hogarius
Posts: 35
Joined: Mon Nov 21, 2011 8:35 pm

Re: Regex Issues - Check this out - Is Mudlet broke?

Post by hogarius »

noblestone, are you sure there aren't some space characters in the prompts with the 3-digit numbers?

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex Issues - Check this out - Is Mudlet broke?

Post by noblestone »

my prompt line is ---> [633:633][112:112][219:508][2857][-:-][Kills:0][XP:0]

there is no spacing, the [-:-] is monitoring others hp, still no affect however if i use bigger alts, 4 digits works fine. Why 3 wont. I am wondering here. You can try this script yourself to test, avatar.outland.org 3000

copy n paste this prompt into game... prompt |y|[|c|%h:%H|y|][|bw|%m:%M|y|][|c|%v:%V|y|];
prompt2 |y|[|bw|%T|y|][|c|%w:%W|y|]

Then type prompt2 to enable it. test it, 2 digits or 3 digits wont work, been like this for 1 1/2 year since I tweaked Geyser UI. Thanks

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Regex Issues - Check this out - Is Mudlet broke?

Post by SlySven »

Is the [-:-] confusing things because the '-' sign can be part of a valid number - but isn't in these cases - could those pair be producing what is typically referred as undefined behaviour? ;)

Post Reply