Francis Lennert (France) Posted December 2, 2005 Share Posted December 2, 2005 Hello All, I don't always understand the StringRegExp syntax. I have today a syntax problem with the | statement. $inc = "251" if StringRegExp( $inc , "^251$|^ABC$",0) = False then MsgBox(0,"Error","The value "&$inc&" is not authorized") EndIf MsgBox(0,"Error",@error) StringRegExp returns False... If I do $inc = "251" if StringRegExp( $inc , "^251$",0) = False then MsgBox(0,"Error","The value "&$inc&" is not authorized") EndIf MsgBox(0,"Error",@error) StringRegExp returns True ... I use this kind of statement with Mysql without troubles ; mysql> select "251" regexp "^251$|^ABC$" ; Which returns True... So, I don't understand what I am doing wrong with AutoIt.. Any Help ??? Regards, Francis Link to comment Share on other sites More sharing options...
Francis Lennert (France) Posted December 2, 2005 Author Share Posted December 2, 2005 Reply to jump in the first Page. If you take a drink with Nutster, the father of StringRegExp, Could you please ask him to take a look at my Post ? Regards, Francis Link to comment Share on other sites More sharing options...
LxP Posted December 2, 2005 Share Posted December 2, 2005 There are currently some open StringRegExp() bugs in the Bug Reports forum; they may possibly be having an effect on your code. You may however wish to try '(^251$)|(^ABC$)' or '^(251|ABC)$' to see if that works properly. Link to comment Share on other sites More sharing options...
Francis Lennert (France) Posted December 2, 2005 Author Share Posted December 2, 2005 (edited) There are currently some open StringRegExp() bugs in the Bug Reports forum; they may possibly be having an effect on your code. You may however wish to try '(^251$)|(^ABC$)' or '^(251|ABC)$' to see if that works properly.Thanks for your answer. I will check that ( didn't know that this open bugs forum exists...)Regards,Francis Edited December 2, 2005 by Francis Lennert (France) 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