MadaraUchiha Posted November 26, 2013 Posted November 26, 2013 Hi, I have a String Like this: $String = 'Numbers:1234567890Letters:abcdefghi' Now, I want: 1) Search for the : in the String. (In this case there are 2 matches.) 2) Get the text atfer teh 1 occurence of : until the second occurence. Would be in this case the green marked part. $String = 'Numbers:1234567890Letters:abcdefghi' 3) Save this text in avariable for later usage. 4) Replace the green text with 'HELLO' 5) Remove the two : 's 6) Display final String in a messagebox. Not sure how to do this without Regex? :/ How can I acomplish this with StringReplace etc?
JohnOne Posted November 26, 2013 Posted November 26, 2013 3) _StringBetween() 4) StringReplace() with result of 3 5) StringReplace() 6) MessageBox() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
jdelaney Posted November 26, 2013 Posted November 26, 2013 output: 1234567890Letters NumbersHELLOabcdefghi $String = 'Numbers:1234567890Letters:abcdefghi' $Stringa = StringRegExpReplace($String, "(.*:)(.*)(:.*)","$2") $Stringb = StringRegExpReplace($String, ":.*:","HELLO") ConsoleWrite($Stringa & @CRLF) ConsoleWrite($Stringb & @CRLF) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
MadaraUchiha Posted November 26, 2013 Author Posted November 26, 2013 Hey, thanks for your reply. But I won't just c&p, I like to understand your code. Can you explain every line pls? I am not so good with Regex...
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