APRES Posted August 22, 2006 Share Posted August 22, 2006 (edited) In the below code I expected that the function will check the string $str for pattern $pattern and will write the found matches into array $Arstr But I get error: Subscript used with non-Array variable.: Do I something wrong or did I understand the documentation not good? Thank you for your short look. Dim $Arstr[2] $str=">4PL Q30.73 197.85TP 4P AMS Q30.73 197.85" $pattern="4P" $Arstr=StringRegExp ( $str, $pattern , 3 ) MsgBox(0, "Found?", @Extended) MsgBox(0, "Show $arstr", $Arstr[1]) Edited August 22, 2006 by APRES Link to comment Share on other sites More sharing options...
Lazycat Posted August 22, 2006 Share Posted August 22, 2006 In order regexp return array you should define capturing group. So your pattern will look like $pattern="(4P)"Text, matched to subexpression in brackets will be placed to array. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
APRES Posted August 22, 2006 Author Share Posted August 22, 2006 Thank you! 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