Sign in to follow this  
Followers 0
Francis Lennert (France)

StringRegExp Syntax

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Francis Lennert (France)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0