Jump to content

$RegExp with user input to change pattern to look for


Recommended Posts

Hi all, im new to autoit but learning the hard way even if this site makes it easier with all the great ppl.

Anyway i wonder if there is a way to make the $RegExp work like this, if a user types in 15 in a input field and then the

code would look like this $RegExp = StringRegExp ($Clip, "(\d{15})", 1), or if the user types 10 instead the code looks like this, $RegExp = StringRegExp ($Clip, "(\d{10})", 1), so i basically wonder if there is a way to use a variable in the "(\d{10})" field were the {10} is located, thanx in advance!

Link to comment
Share on other sites

I don't know exactly what you want, but it is easy to have a variable in the pattern.

$iNum = 10
StringRegExp($Clip, "(d{" & $iNum & "})", 1)

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

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...