Another Regexp that is killing me.

Posted by Halig on Fri 01 Jan 2016 07:51 PM — 3 posts, 13,452 views.

Portugal #0
Hi people.
I had the Health Bar working, but i mess it up when i start playing with the prompt and now i can't remember the regexp that i had. Been trying alot but can't manage to get it working.

My prompt:

<%h/%H {b%m/%M{x {g%v/%V{x %B %e {r>{x

Wich returns:

<2717/2717 982/982 1037/1037 E >

Now, i've been trying to set the trigger for the Health Bar plugin.


<triggers>
  <trigger
   enabled="y"
   match="^\<(\d+)\/(\d+)(\s*)(\d+)\/(\d+)(\s*)(\d+)\/(\d+)$"
   regexp="y"
   script="do_prompt"
   sequence="100"
  >
  </trigger>
</triggers>


Then we have the part of the wildcards:


function do_prompt (name, line, wildcards)

  hp, max_hp = tonumber (wildcards [2]), tonumber (wildcards [3])
  mana, max_mana = tonumber (wildcards [5]), tonumber (wildcards [6])
  move, max_move = tonumber (wildcards [8]), tonumber (wildcards [9])


I know that the problem is in the regexp, but i can't figure out where.

[EDIT] Changed [\code] to [/code].
Amended on Sat 02 Jan 2016 01:36 AM by Nick Gammon
Australia Forum Administrator #1
Try getting rid of the final "$" because you have more on the line (the "E >" in this case).
Portugal #2
Hello Nick. Thank you, i had to change more things, but the $ at the end was the cause of it not working.
Thank you again.