Lukas Posted May 9, 2012 Posted May 9, 2012 (edited) $sText = '<djsj>' & @CRLF & _ '<asdsdd>' & @CRLF & _ '<erwerds>' & @CRLF & _ '<title>' & @CRLF & _ 'Hello ' & @CRLF & _ 'World!' & @CRLF & _ '</title>' & @CRLF & _ '<sdadas>' & @CRLF & _ '<sfasd>' & @CRLF & _ '<xczczx>' & @CRLF $sResult = StringRegExpReplace($sText, "(.*v)*(s)*<title>(.*)</title>(v.*)*", "$3") MsgBox(0, "", "Result: " & $sResult & @CRLF & @CRLF & "Should be like this: Hello World!") Someone can help me, without using _StringBetween? Edited May 9, 2012 by LukaS
qsek Posted May 9, 2012 Posted May 9, 2012 @CRLF can be a bitch sometimes (?s) is the way to go for multiline Regexes $sText = '<djsj>' & @CRLF & _ '<asdsdd>' & @CRLF & _ '<erwerds>' & @CRLF & _ '<title>' & @CRLF & _ 'Hello ' & @CRLF & _ 'World!' & @CRLF & _ '</title>' & @CRLF & _ '<sdadas>' & @CRLF & _ '<sfasd>' & @CRLF & _ '<xczczx>' & @CRLF $sResult = StringRegExpReplace($sText, "(?s).*<title>(.*)</title>.*", "$1") $sResult = StringReplace(StringReplace($sResult, @LF, ""), @CR, "") ConsoleWrite("Result: " & $sResult & @CRLF & @CRLF & "Should be like this: Hello World!" & @CRLF) Lukas 1 Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
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