gcue Posted December 30, 2008 Posted December 30, 2008 (edited) this line picks out the line that has "full name: blah,blah" in a text file then creates an array for the name $var=StringRegExp($string, "(?:Full Name.\s+)(.*),.(.*)\r\n", 3) If IsArray($dname) Then For $x = 0 To UBound($dname) - 1 ConsoleWrite($dname[$x] & @CRLF) Next endif sometimes "blah,blah" is not seperated by a comma, how can i account account for both cases? Edited December 30, 2008 by gcue
Pain Posted December 30, 2008 Posted December 30, 2008 (edited) I guess you are looking for "|" also know as OR. or use [ ... ] (Match any character in the set) Edited December 30, 2008 by Pain
PsaltyDS Posted December 30, 2008 Posted December 30, 2008 this line picks out the line that has "full name: blah,blah" in a text file then creates an array for the name $var=StringRegExp($string, "(?:Full Name.\s+)(.*),.(.*)\r\n", 3) If IsArray($dname) Then For $x = 0 To UBound($dname) - 1 ConsoleWrite($dname[$x] & @CRLF) Next endif sometimes "blah,blah" is not seperated by a comma, how can i account account for both cases? If no comma, then what would be there? StringRegExp() is no psychic and you will have to specify what you want. Where you have ",." there could be an alternate pattern like ",|\s" which would match either a comma or a single space. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
gcue Posted December 30, 2008 Author Posted December 30, 2008 worked like a charm... many thanks psalty!
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