I have a html document and I have to replace all href url with another url using Erlang. I am beginner for erlang. Can any one help me on this?
Asked
Active
Viewed 239 times
0
-
I tried to search on google but nothing I got till now... – Ajay V Apr 11 '12 at 13:26
-
I meant show us the code you have so far with a hole where you need help.. – barsju Apr 11 '12 at 13:36
-
2http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – Roberto Aloi Apr 11 '12 at 14:23
1 Answers
2
You can use regular expressions for it. There is 're' module in erlang and you can use replace/3
eg.
re:replace("kuba","b","[&]",[{return,list}]).
gives you:
"ku[b]a"
http://schemecookbook.org/Erlang/RegexChapter doc for replace/3 http://www.erlang.org/doc/man/re.html#replace-3
I hope this helps.

Jakub Oboza
- 5,291
- 1
- 19
- 10
-
Thanks Jakub it helped me and got the idea and resolved my problem but...need 1 more help... I have a html content and I have to replace href with my href so I am replacing href=" to href="my url here. SO at the place of & also its replacing href="...Cud u please help me how to escape & in erlang. Thanks – Ajay V Apr 12 '12 at 18:25
-