Hello Everyone,
I am trying to use regex with replace to remove/edit tags in an html document I have my new app download.
I am using the code I found here and I know it works.
html = RegexReplace("<head>", html, "<boots>") <-- this code works
html = html.Replace("/<head>(.*?)<\/head>/si", "") <-- This code doesn't work
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
I believe the regex code doesnn't work because the search is going accross multiple lines of html. I use the regex /<head>(.*?)<\/head>/si in php and it works fine.
I would really appreciate help from any on you here.
I am trying to use regex with replace to remove/edit tags in an html document I have my new app download.
I am using the code I found here and I know it works.
html = RegexReplace("<head>", html, "<boots>") <-- this code works
html = html.Replace("/<head>(.*?)<\/head>/si", "") <-- This code doesn't work
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
I believe the regex code doesnn't work because the search is going accross multiple lines of html. I use the regex /<head>(.*?)<\/head>/si in php and it works fine.
I would really appreciate help from any on you here.