468,101 Members | 1,350 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,101 developers. It's quick & easy.

Regex replace

Dear Sir, I need to use regex to replace some string.

Below is what I use.

output = "sample data <href=""xlink:GG44-33"">, part two
<href=""xlink:GG55-123"">"
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "href=\""(xlink:.*?)\"""
output = regEx.Replace(output,"href="&chr(34) &
GetDatabaseLink("$1")&chr(34))

Function GetDatabaseLink(Byval input)
'' query database based on "input" value and return value on database.
End Function

the value inside <hreftag needs to be replaced by real value from
database. Function GetDatabaseLink get the value from match string and send
it to database for query. What the database receive right now is the value
of "$1", instead of "xlink:GG44-33" and "xlink:GG55-123" in this case.

What did I do wrong?
Regards,

Guoqi Zheng

Mar 17 '08 #1
0 1704

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by bill tie | last post: by
6 posts views Thread by tshad | last post: by
17 posts views Thread by clintonG | last post: by
9 posts views Thread by Whitless | last post: by
4 posts views Thread by Morgan Cheng | last post: by
15 posts views Thread by morleyc | last post: by
reply views Thread by Karch | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.