hit points regex

Post Reply
THUFIR
Posts: 1
Joined: Tue Aug 27, 2013 5:27 am

hit points regex

Post by THUFIR »

Hi,

Would I be able to capture hit point type numbers from this sequence:

You attack Worshipper
22:00 689 438 >>
HP: 666/700 CP: 438/691
You are fighting Worshipper
Your body closes up some of your wounds
HP: 676/700 CP: 437/691 ADRENALINE: 105 ENDORPHINE: 0 BERSERK: 10 Worshipper: 55%


thanks,

Thufir

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: hit points regex

Post by phasma »

Assuming you only want to capture the HP's, this will do what you need:

Code: Select all

^HP\: (\d+)\/(\d+) CP\: (\d+)\/(\d+)( .+)?$
Your actual current HP will be stored in matches[2], with the max stored in matches[3].

Post Reply