myspacee Posted August 8, 2008 Posted August 8, 2008 (edited) hello, need to replace text between know marker (*, #, etc.). ES: *random_text* -> *my_text* read help for StringRegExp function but is a bit too hard for me, anyone can suggest me right way ? Thank you, m. --edit-- add my line to explain : <div align="center">Check : --time_15:00--</div> must replace with : <div align="center">Check : --time_18:30--</div> where time_ is a variable Edited August 8, 2008 by myspacee
BrettF Posted August 8, 2008 Posted August 8, 2008 This worked for me #include <String.au3> $string = _StringReplaceBetween ('<div align="center">Check : --time_15:00--</div>', '<div align="center">', '</div>', 'Check : --time_18:30--') MsgBox (0, "", $string) Func _StringReplaceBetween ($sString, $sStart, $sEnd, $sReplace) $searchstring = _StringBetween ($sString, $sStart, $sEnd) If @error Then SetError (1, -1, 0) $return = StringReplace ($sString, $searchstring[0], $sReplace) Return $return EndFunc Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
GEOSoft Posted August 8, 2008 Posted August 8, 2008 StringRegExpReplace() in the help file. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
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