DigitalIsBetter Posted August 16, 2008 Share Posted August 16, 2008 (edited) Probably a noob question but when I make an array with stringregexp how do i know how many matchs it found? I know i can do _arraydisplay but I need to set a variable to the number of items in the array. Thanks for any help in advance. Edited August 16, 2008 by Learning Link to comment Share on other sites More sharing options...
Valuater Posted August 16, 2008 Share Posted August 16, 2008 Maybe... $array = StringRegExp('<test>a</test> <test>b</test> <test>c</Test>', '<(?i)test>(.*?)</(?i)test>', 3) MsgBox(0x0, "total", UBound($array)) for $x = 0 to UBound($array) -1 MsgBox(0x0, "Number " & $x, $array[$x], 2) Next Ubound() is your friend!!! 8) Link to comment Share on other sites More sharing options...
DigitalIsBetter Posted August 16, 2008 Author Share Posted August 16, 2008 Maybe... $array = StringRegExp('<test>a</test> <test>b</test> <test>c</Test>', '<(?i)test>(.*?)</(?i)test>', 3) MsgBox(0x0, "total", UBound($array)) for $x = 0 to UBound($array) -1 MsgBox(0x0, "Number " & $x, $array[$x], 2) Next Ubound() is your friend!!! 8) Thanks man didnt know about Unbound Link to comment Share on other sites More sharing options...
therks Posted August 16, 2008 Share Posted August 16, 2008 UBound, not Unbound Means "Upper Boundary" My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 16, 2008 Share Posted August 16, 2008 UBound, not Unbound Means "Upper Boundary" Or constipated: If $iCheese > $iLimit Then Ubound(":") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now