McGod Posted October 31, 2007 Posted October 31, 2007 I need something that will go [0-9:;+'] (Like 0,1,2,3,4,5,6,7,8,9,:,;,+,') In a StringRegExp bracket, but it doesnt work:( Can anyone figure out a way of doing it? [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 October 31, 2007 Moderators Posted October 31, 2007 I need something that will go [0-9:;+'] (Like 0,1,2,3,4,5,6,7,8,9,:,;,+,') In a StringRegExp bracket, but it doesnt work:( Can anyone figure out a way of doing it?Do you have an actual string to work with an an example output desired? 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 October 31, 2007 Author Posted October 31, 2007 Im trying to parse a ÿc1 string, the 1 is the character im trying to get, although it could be anywhere within a string likeExampleÿc5 ]]]]]]]]]] Preserved Head ÿc;-Which I would parse to be able to getthe 5 and ; in the array.I've triedLocal $sStats = StringRegExp($sStat[$i], "(?i)ÿc[0-9][;][:][+][']", 1, 1)Local $sStats = StringRegExp($sStat[$i], "(?i)ÿc[0-9;:+']", 1, 1)Local $sStats = StringRegExp($sStat[$i], "(?i)ÿc[0-9][;:+']", 1, 1) [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 October 31, 2007 Moderators Posted October 31, 2007 (edited) Try this:#include <array.au3> $sString = "ÿc5 ]]]]]]]]]] Preserved Head ÿc;-" $aSRE = StringRegExp($sString, "(?s)(?i)ÿc(\d+).+?(;|'|:|\+)", 3) _ArrayDisplay($aSRE)Edit:Or this expression:#include <array.au3> $sString = "ÿc5 ]]]]]]]]]] Preserved Head ÿc;-" $aSRE = StringRegExp($sString, "(?s)(?i)ÿc(\d+).*?ÿc(;|'|:|\+)", 3) _ArrayDisplay($aSRE) Edited October 31, 2007 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.
McGod Posted October 31, 2007 Author Posted October 31, 2007 it works:) Big thanks! [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]
Bowmore Posted October 31, 2007 Posted October 31, 2007 Do you have an actual string to work with an an example output desired? Another Example for you to lookat #include <array.au3> Dim $sString = " ÿc4]]]]ÿc:]]]]]ÿc+] Preserved ÿc5 Head ÿc;-" Dim $sPattern = "(?:ÿc([0-9:;+']))" Dim $aResult = 0 $aResult = StringRegExp($sString,$sPattern,3) _ArrayDisplay($aResult) "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
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