With this ASP:
This isn't working at all. Any help?Code:<% @Language="VBScript" %>
<%
Option Explicit
Dim strTestOne
strTestOne = "Blah"
Dim strTestTwo
strTestTwo = "Blah yadda yadda yadda Blah"
Dim strResultOne, strResultTwo
Dim objRegEx
Set objRegEx = New regexp
objRegEx.IgnoreCase = True
objRegEx.Global = True
objRegEx.Pattern = "\[url=""(.+)""\](.+)\[\/url\]"
strResultOne = objRegEx.Replace(strTestOne, "<a href=""\1"">\2</a>")
strResultTwo = objRegEx.Replace(strTestTwo, "<a href=""\1"">\2</a>")
%>
<html>
<head>
<title>VBScript RegEx Test</title>
</head>
<body>
<p>Test string: <%=strTestOne%></p>
<p>Result string: <%=strResultOne%></p>
<p>Test string: <%=strTestTwo%></p>
<p>Result string: <%=strResultTwo%></p>
<p>Pattern: <%=objRegEx.Pattern%></p>
</body>
</html>
[/code]
I get these reults:
[code]
<html>
<head>
<title>VBScript RegEx Test</title>
</head>
<body>
<p>Test string: [vrl="http://www.foo.com/bar.html"]Blah[/vrl]</p>
<p>Result string: <a href="\1">\2</a></p>
<p>Test string: [vrl="http://www.foo.com/bar.html"]Blah[/vrl] yadda yadda yadda [vrl="http://www.foo.com/bar.html"]Blah[/vrl]</p>
<p>Result string: <a href="\1">\2</a></p>
<p>Pattern: \[url="(.+)"\](.+)\[\/url\]</p>
</body>
</html>
Note: "url" changed to "vrl" in some places in the response code to get past vBulletin.
