Overview of cpe.inc

Public Function Summary

Public functions are intended to be called by the code that imports this library.

Name Summary
build_cpe

Public Function Details

build_cpe

Named Parameters

base
exp
value

Code

function build_cpe(value, exp, base) {
  local_var res, last;

  if (isnull(value) || isnull(exp) || isnull(base))
      return NULL;

  res = eregmatch(string:value, pattern:exp, icase:1);
  if (res[1]) {
    last = strlen(base) - 1;
    if (":" >!< base[last]) {
      return base;
    } else if (res[1] && res[2]) {
      return string(base, res[1], ":", res[2]);
    } else if (res[1]) {
      return string(base, res[1]);
    }
  }
  return NULL;
}



		
top