Alexxander 4 Posted September 10, 2013 Hello i have this sentence [24] hi all i'am an example is there is a way to get all the numbers in this sentence ? i want Autoit to give me 24 in a variable is this possible ? Share this post Link to post Share on other sites
FireFox 260 Posted September 10, 2013 Hi, Have you looked at the String* functions in the helpfile? Especially StringMid/StringInStr or _StringBetween? (or StringRegExp but I doubt you will be able to do something with it). Br, FireFox. 1 Alexxander reacted to this OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDFMy Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme makerMy Examples : Capture tool | IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewerMy Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control Share this post Link to post Share on other sites
Terenz 29 Posted September 10, 2013 Local $aFinal $aString = "[24] hi all i'am an example" $aResult = StringRegExp($aString, "\d", 3) For $x = 0 To UBound($aResult) -1 $aFinal &= $aResult[$x] Next ConsoleWrite($aFinal) 1 Alexxander reacted to this Nothing is so strong as gentleness. Nothing is so gentle as real strength Share this post Link to post Share on other sites
FireFox 260 Posted September 10, 2013 This is a trivial question, giving an example is not going to solve his lack of "reading the helpfile". 1 Alexxander reacted to this OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDFMy Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme makerMy Examples : Capture tool | IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewerMy Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control Share this post Link to post Share on other sites
Alexxander 4 Posted September 10, 2013 (edited) Terenz thank you bro appreciated ------------------------------------------------------------------------------------------------------------------------------------------------------------------ FireFox thank you man you are a teacher and i am so lazy Edited September 10, 2013 by Alexxander Share this post Link to post Share on other sites
FireFox 260 Posted September 10, 2013 Alexxander, The RegExp solution given will extract all numbers, if you want only to extract the numbers between brackets, use this simple pattern: "[d]". PS: A forum search will be faster than creating a topic and waiting for answers Br, FireFox. 1 Alexxander reacted to this OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDFMy Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme makerMy Examples : Capture tool | IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewerMy Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control Share this post Link to post Share on other sites
Malkey 231 Posted September 10, 2013 (edited) Alexxander,The RegExp solution given will extract all numbers, if you want only to extract the numbers between brackets, use this simple pattern: "[d]". PS: A forum search will be faster than creating a topic and waiting for answers Br, FireFox.FireFoxBad guess."[d]" is the same as "[0-9]" which is the same as "d".If you want only to extract the numbers between brackets, use this simple pattern: "[(d+)]". Edited September 10, 2013 by Malkey 1 jchd reacted to this Share this post Link to post Share on other sites
FireFox 260 Posted September 10, 2013 FireFox Bad guess. "[d]" is the same as "[0-9]" which is the same as "d". If you want only to extract the numbers between brackets, use this simple pattern: "[(d+)]". Yes sure 1 Alexxander reacted to this OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDFMy Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme makerMy Examples : Capture tool | IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewerMy Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control Share this post Link to post Share on other sites