
Hi, I am trying to replace every occurrence of http://URL or https://URL with: <a href="http://URL"> http://URL </a> <a href="https://URL"> https://URL </a> respectively in a text file. I tried with Text.Regex with an example: Prelude> let s = "Google website is http://www.google.com in US" Prelude> import Text.Regex Prelude Text.Regex> let s3 = subRegex (mkRegex "https?:[^\\s\n\r]+") s "</a>" Prelude Text.Regex> s3 "Google website is I then tried a simpler example: Prelude Text.Regex> subRegex (mkRegex "e") "hello" "\\1" "h*** Exception: Ix{Int}.index: Index (1) out of range ((0,0)) What could I be missing? I am using GHCi 6.12.3 on Fedora 14. Appreciate any help in this regard. Thanks, SK -- Shakthi Kannan http://www.shakthimaan.com