Sign in to follow this  
Followers 0
Cubehead

Stringregexp Problem

3 posts in this topic

Hi, when I use something like $var=StringRegExp($somestring, "[a-z]{1,10}") it works but if I try to use $var=StringRegExp($somestring, "[a-z]{1,}]"), I get an @error = 2. What am I doing wrong ?

I'm using the v3.1.1.120 beta

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi, when I use something like $var=StringRegExp($somestring, "[a-z]{1,10}") it works but if I try to use $var=StringRegExp($somestring, "[a-z]{1,}]"), I get an @error = 2. What am I doing wrong ?

I'm using the v3.1.1.120 beta

I get the error too, I guess if they say you should post it in bug reports that Nutster will add it to his "To Do" list for StringRegExp()... but this may be a dirty work around for you until then:
$somestring = 'ablAAdGGfoi'
$var = StringRegExp($somestring, "[a-z]{1," & StringLen($somestring) & "}")
ConsoleWrite(@error & @LF)

Edit:

P.S. your example of the issue has an extra bracket in it that it doesn't need, I thought that was the error at first (I highlighted it).

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I get the error too, I guess if they say you should post it in bug reports that Nutster will add it to his "To Do" list for StringRegExp()... but this may be a dirty work around for you until then:

$somestring = 'ablAAdGGfoi'
$var = StringRegExp($somestring, "[a-z]{1," & StringLen($somestring) & "}")
ConsoleWrite(@error & @LF)

Edit:

P.S. your example of the issue has an extra bracket in it that it doesn't need, I thought that was the error at first (I highlighted it).

Gah, I knew I should have double checked my post. Thanks for your answer.

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