Make sure you're checking @error as well. With your current exp
ression it's returning 2.
Lemme see if I can code something up that works, but unfortunately I'm flying blind as I just realized that I can't find any documentation on the function either!
Also unfortunately, I'm not totally sure what it is you want here. But here's the best I could figure out.
$String = "200% defense 200% damage +4 Light radius +1 all skills +5 dex +14 mana"
$RegExp = StringRegExp($String, "([0-9]+% damage).*?\+([0-9]+ all skills).*?\+([0-9]+ mana).*", 1)
For $i = 0 to UBound($RegExp) - 1
MsgBox("","", $RegExp[$i] )
The ? you see after the .* is telling it to be "ungreedy".
This is because if you allow it to go unchecked, then .* will match as much as possible. So if you have this exp
ression for example:
String: "<Hello> <World>"
It's going to return "Hello> <World"
See where I'm going? It matched too much. But if your RegExp was: "<(.*?)>"
Then it will return "Hello" and "World" because it matched them individually.
Don't know how much better I can explain it than that, sorry. And hopefully some of the dev's will get the docs back up and included in the next beta or something. Personally, I can't wait to be able to use Holger's TrayMenu and Nutster's RegExp functions all in one script!