How to get values from within parentheses
Posted: Sat Jan 09, 2021 4:37 am
Hello Folks,
I'm quite new and have run into a bit of a roadblock. I'm attempting to get the value of the current and max values of the characters stats in the following line:
Sheynna < PC (Ne1) - 25(25)H 108(108)M 122(122)V> (Leader)
The issue I am running into is that the parentheses in the above line seem to cause issues with the code. The closest I am getting is:
^ Sheynna < PC (.*) - (\d+)((\d+))
matches[3] returns as 2 here instead of 25.
I'd appreciate any guidance you folks could offer.
Thank you!
I'm quite new and have run into a bit of a roadblock. I'm attempting to get the value of the current and max values of the characters stats in the following line:
Sheynna < PC (Ne1) - 25(25)H 108(108)M 122(122)V> (Leader)
The issue I am running into is that the parentheses in the above line seem to cause issues with the code. The closest I am getting is:
^ Sheynna < PC (.*) - (\d+)((\d+))
matches[3] returns as 2 here instead of 25.
I'd appreciate any guidance you folks could offer.
Thank you!