MadaraUchiha Posted November 26, 2013 Share 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? Link to comment Share on other sites More sharing options...
JohnOne Posted November 26, 2013 Share 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. Link to comment Share on other sites More sharing options...
jdelaney Posted November 26, 2013 Share 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. Link to comment Share on other sites More sharing options...
MadaraUchiha Posted November 26, 2013 Author Share 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... 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