svenjatzu Posted August 1, 2019 Share 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. Link to comment Share on other sites More sharing options...
Nine Posted August 1, 2019 Share 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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
mikell Posted August 1, 2019 Share 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 Link to comment Share on other sites More sharing options...
svenjatzu Posted August 2, 2019 Author Share Posted August 2, 2019 thanks love you ❤️ 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