svenjatzu Posted August 1, 2019 Posted August 1, 2019 Hey im trying to combine both the functions but i aint get the value i need. this is how i try it #include <MsgBoxConstants.au3> #include <StringConstants.au3> Local $bString = StringStripWS(ClipGet(), $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) Local $sString = Stringright($bString,2) ; Retrieve 5 characters from the left of the string. MsgBox($MB_SYSTEMMODAL, "", "The 5 leftmost characters are: " & $sString) value in getclip is "monsteri-12345 " to replace first the spaces and then only show the last 6 values. can you please help me? other thought is to just replace all the letters and - and just show the numbers. the numbers are what i need.
Nine Posted August 1, 2019 Posted August 1, 2019 Local $sNum = StringRegExp ("monsteri-12345 ", "-(\d+)",$STR_REGEXPARRAYMATCH)[0] “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
mikell Posted August 1, 2019 Posted August 1, 2019 So many ways to skin this cat ... $s = " monsteri - 12345 " ; the numbers are what i need $r1 = StringRegExpReplace($s, '.*?(\d+).*', "$1") Msgbox(0,"", $r1) ; just replace all the letters and - and just show the numbers $r2 = StringRegExpReplace($s, '\D', "") Msgbox(0,"", $r2) svenjatzu 1
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