
On Saturday 12 November 2011, 16:10:58, Shakthi Kannan wrote:
Hi,
--- On Sat, Nov 12, 2011 at 8:20 PM, Daniel Fischer
wrote: | Prelude Text.Regex> subRegex (mkRegex "https?[^[:space:]]+") "The best | is http://haskell.org\n" "there</a>" | "The best is http://haskell.org\">there</a>\n" \--
Is there any way we can escape the " within <a href></a>, and not get the \" in the output?
The \" are just because that's Haskell's way of showing Strings. Strings are shown enclosed in quotes, and quotes (and other characters) appearing in the String are escaped. You can see what would get written to the file by outputting the String with putStrLn, Prelude Text.Regex> putStrLn $ subRegex (mkRegex "https?://([:alpha:]| [0-9]|.[[:alpha:]0-9])+") "The best is http://haskell.org." "there</a>" The best is <a href="http://haskell.org">there</a>. See, just like it should be.
I am producing HTML in the output, and the \" doesn't work with the anchor tag. Expected output is:
"The best is <a href="http://haskell.org">there</a>\n"
Thanks for your prompt help!
SK