0

我有下面的Url,在那|| 我想用 re:replace 替换回 &。

"a href=\"http://znetratest23.com/wp-content/plugins/email-management/emailClick.php?userName=mar26reseller||reportType=C||campaignId=4F4F52CEA941153719000000||email={{toemail}} ||score=40||url="

像这样...

"a href=\"http://znetratest23.com/wp-content/plugins/email-management/emailClick.php?userName=mar26reseller&reportType=C&campaignId=4F4F52CEA941153719000000&email={{toemail}}&score=40&url="

我已经尝试过使用下面的代码,但它对我不起作用。

EscClickUrl = "a href=\"http://znetratest23.com/wp-content/plugins/email-management/emailClick.php?userName=mar26reseller||reportType=C||campaignId=4F4F52CEA941153719000000||email={{toemail}}||score=40||url=",
EscClickUrl1 = re:replace(EscClickUrl, "||", "\&", [global, {return,list}]).

谁可以帮我这个事...

谢谢。

4

1 回答 1

2

使用双反斜杠:

1> EscClickUrl = "a href=\"http://znetratest23.com/wp-content/plugins/email-management/emailClick.php?userName=mar26reseller||reportType=C||campaignId=4F4F52CEA941153719000000||email={{toemail}}||score=40||url=",
1> re:replace(EscClickUrl, "\\|\\|", "\\&", [global, {return,list}]).
"a href=\"http://znetratest23.com/wp-content/plugins/email-management/emailClick.php?userName=mar26reseller&reportType=C&campaignId=4F4F52CEA941153719000000&email={{toemail}}&score=40&url="
于 2012-04-12T19:39:52.147 回答