Jump to content

Recommended Posts

Posted

#include <Array.au3>

ClipPut('lolol12ll12')
$speed = StringRegExp(ClipGet(), '[0-9]', 3)
If Not @error Then
    MsgBox(0, '', _ArrayToString($speed, ''))
Else
    MsgBox(0, '', 'No numbers found')
EndIf

Posted

just need help to extract integers from this:

so if the clipboard had "kijs123ki8 9 asd3" speed will = 123893

thanks

$s = "kijs123ki8 9 asd3" 
;speed will = 123893
$speed = StringRegExpReplace($s,"[^0-9]","")
ConsoleWrite( $speed & @CRLF)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

just need help to extract integers from this:

so if the clipboard had "kijs123ki8 9 asd3" speed will = 123893

thanks

My suggestion would be to iterate through the string 1 character at a time and if you hit a number store that in a temp variable. Once the process complets you will have your number.

Posted

$s = "kijs123ki8 9 asd3" 
;speed will = 123893
$speed = StringRegExpReplace($s,"[^0-9]","")
ConsoleWrite( $speed & @CRLF)
better way than mine, I forgot the ''^'' xD

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...