I have another question for regular expression in F#:
let tagName = "div"
let ptnTagNotClose = "<" + tagName + "(>|\s+[^>]*>)[^<]"
I want to find the matches for not closing tag in HTML file. The pattern string works in VB.NET. But for F#, when I debug the above code, I can see the value for ptnTagNotClose:
ptnTagNotClose "<div(>|\\s+[^>]*>)[^<]"
F# automatically change "\s+" to "\\s+", but for regular expression, "\s+" and "\\s+" are different, the results are also different. Please let me know what to do to avoid F# automatically change the string pattern.
Verbatim string literal could be one solution, but since the tagName can change, i.e. let tagName = "br", then how I can apply verbatim string literal in this case?
Thanks!
John