Jump to content

Stringregexp Problem


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...