Qlik Community

QlikView Documents

Documents for QlikView related information.

Function to strip HTML codes from a field during load script

dgreenberg
Contributor III

Function to strip HTML codes from a field during load script

This function is called from the load script.

Example:

Load field1,

        stripHTML(field2) as field2

from hasHTMLCode.qvd(qvd);

Function stripHTML(strHTML)
   Dim objRegExp, strOutput
  Set objRegExp = New Regexp
  objRegExp.IgnoreCase = True
  objRegExp.Global = True
  objRegExp.Pattern = "(?:<style.+?>.+?</style>|<script.+?>.+?</script>|<(?:!|/?[a-zA-Z]+).*?/?>)"
  'Replace all HTML tag matches with the empty string
  strOutput = objRegExp.Replace(strHTML, "")
  stripHTML = strOutput 'Return the value of strOutput
  Set objRegExp = Nothing
End Function
Tags (3)
Labels (2)
Version history
Revision #:
1 of 1
Last update:
‎02-05-2016 01:38 PM
Updated by: