Kiti Posted July 13, 2008 Share Posted July 13, 2008 This is the string:Resursele pe knight world [1:265:8] (Jucator 'azumy'')la 07-13 15:39:15Metal: 106.129 Cristal: 27.219Deuteriu: 8.028 Energie: 1.900Total: 141376 Raid: 4FloteTransportor Mic 1AparareRacheta Anti-Balistica 4The bolded words never changes. I want to take out the underlined time. I've managed to do this using multiple StringSplits, but I want to do it using StringRegExp:$y = "Resursele pe knight world [1:265:8] (Jucator 'azumy') la 07-13 15:39:15 Metal: 106.129 Cristal: 27.219 Deuteriu: 8.028 Energie: 1.900 Total: 141376 Raid: 4 Flote Transportor Mic 1 Aparare Racheta Anti-Balistica 4" $1 = StringSplit($y, " la ", 1) $2 = StringSplit($1[2], "Metal", 1) $3 = StringSplit($2[1], " ", 1) If @error == 0 Then MsgBox(0, "", $3[2]) EndIfAny clue how? muttley Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 13, 2008 Share Posted July 13, 2008 Hi, option 3 with this pattern \d\d:\d\d:\d\d Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Kiti Posted July 13, 2008 Author Share Posted July 13, 2008 $y = "Resursele pe knight world [1:265:8] (Jucator 'azumy') la 07-13 15:39:15 Metal: 106.129 Cristal: 27.219 Deuteriu: 8.028 Energie: 1.900 Total: 141376 Raid: 4 Flote Transportor Mic 1 Aparare Racheta Anti-Balistica 4" $p = StringREgExp($y, "(\d\d:\d\d:\d\d)", 3) msgbox(0,"",$p[0]) That's just perfect! muttley But how does it know it should take 15:39:15 and not 1:265:8 ? Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 13, 2008 Share Posted July 13, 2008 $y = "Resursele pe knight world [1:265:8] (Jucator 'azumy') la 07-13 15:39:15 Metal: 106.129 Cristal: 27.219 Deuteriu: 8.028 Energie: 1.900 Total: 141376 Raid: 4 Flote Transportor Mic 1 Aparare Racheta Anti-Balistica 4" $p = StringREgExp($y, "(\d\d:\d\d:\d\d)", 3) msgbox(0,"",$p[0]) That's just perfect! muttley But how does it know it should take 15:39:15 and not 1:265:8 ? Cause you tell it to do so. number number : number number : number number thats not the same like number : number number number : number Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
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