McGod Posted November 14, 2007 Posted November 14, 2007 $array = StringRegExp('Required Level: 40', '\A(?i)Required Level: (.+?)', 3) Only returns a 4. Something wrong with my (.+?) ? Replacing the + with a * gives me nothing:( [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
Nahuel Posted November 14, 2007 Posted November 14, 2007 (edited) Any of these should work: $array = StringRegExp('Required Level: 40', '[0-9]{2}', 1) MsgBox(0,"",$array[0]) $array = StringRegExp('Required Level: 40', '[[:digit:]]+', 1) MsgBox(0,"",$array[0]) -edit- For yours to work, just remove the ? from (.+?) Edited November 14, 2007 by Nahuel
Moderators SmOke_N Posted November 14, 2007 Moderators Posted November 14, 2007 What is \A for? 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.
McGod Posted November 15, 2007 Author Posted November 15, 2007 Removing the ? worked, thanks. Smoke_N: \A Match only at beginning of string. Need for incase something like Dexterity: 15 Required Dexerity: 15 would both be postive for Dexterity: (.+) although with a \A only the first one would be. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
Moderators SmOke_N Posted November 15, 2007 Moderators Posted November 15, 2007 Removing the ? worked, thanks.Smoke_N: \A Match only at beginning of string. Need for incase something likeDexterity: 15Required Dexerity: 15would both be postive forDexterity: (.+)although with a \A only the first one would be.^The above you can use to match at the beginning of a string.(?i)^Dexterity: (.+?)That will match any chars from the start of the space until the end of the string (not case sensitive). 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.
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