Hi
im trying to find iframe tags in a string and append an empty line after them
B4X:
Log(RegexReplace("(<iframe.*<\/iframe>)", "sometext<iframe-sometext-</iframe>sometext", "$1" & "<br>"))
Sub RegexReplace(Pattern As String, Text As String, Replacement As String) As String
Dim m As Matcher
m = Regex.Matcher(Pattern, Text)
Dim r As Reflector
r.Target = m
Return r.RunMethod2("replaceAll", Replacement, "java.lang.String")
End Sub
You are doing something wrong.
If you only want to replace the text between the iframe elements then you should move the parenthesis to capture only that text.