
StringRegExp --> StringRegExpReplace
-
Bitnugger -
23. April 2020 um 08:21 -
Erledigt
-
-
Was/Womit willst du denn replacen?
-
Was/Womit willst du denn replacen?
Ich möchte das StringRegExpReplace dasselbe Ergebnis liefert, dass ich mit StringRegExp bekomme.
StringRegExp: 6.2 based on 376,127 user ratings
StringRegExpReplace: 6.2 based on 376,127 user ratings
Nur bekomme ich das Pattern nicht hin...
-
-
ConsoleWrite(StringRegExpReplace($sBody, "(?s).*strong title=""(.+?)"".+", "\1") & @CRLF)
So ähnlich hatte ich es versucht, nur hatte ich da kein ? hinter (.+?).
So funktioniert es.
AutoItLocal $sBody = BinaryToString(InetRead('http://www.imdb.com/title/tt1399103/')) ConsoleWrite('> StringRegExp: ' & StringRegExp($sBody, '(?U).*strong title="(.+)".*', 1)[0] & @CRLF) ConsoleWrite('- StringRegExpReplace: ' & StringRegExpReplace($sBody, "(?s).*strong title=""(.+?)"".+", "\1") & @CRLF) ConsoleWrite('- StringRegExpReplace: ' & StringRegExpReplace($sBody, '(?s).*strong title="(.+?)".+', '\1') & @CRLF) ;> StringRegExp: 6.2 based on 376,129 user ratings ;- StringRegExpReplace: 6.2 based on 376,129 user ratings ;- StringRegExpReplace: 6.2 based on 376,129 user ratings
Danke!