Q:

C++ regex header not registering for Netezza UDF

I am compiling a UDF on IBM's Netezza using C++ as per the documentation here. My code compiles with no issues 
#include <stdarg.h>
#include <string.h>
#include <regex.h>
#include "udxinc.h"
#include "udxhelpers.h"

using namespace nz::udx_ver2;

class Dateconvert: public Udf
{
public:
    Dateconvert(UdxInit *pInit) : Udf(pInit){}
    ~Dateconvert(){}

    static Udf* instantiate(UdxInit *pInit);
    virtual ReturnValue evaluate()
    {

      StringReturn* ret = stringReturnInfo();
      StringArg *str;
      str = stringArg(0);
      int lengths = str->length;
      char *datas = str->data;
      char retval[100];
      strcpy(retval,"99991231");

      ret->size = sizeof(retval);
      memcpy(ret->data, retval, sizeof(retval));

      NZ_UDX_RETURN_STRING(ret);
    }
};

Udf* Dateconvert::instantiate(UdxInit *pInit)
{
      return new Dateconvert(pInit);
}

I need to use regex to process the string argument with some regular expression logic. However, when I try to add in 
#include <regex>

or
#include <regex.h>

And the code regex-specific code:
string int_num= "some pattern"
string test= "test"
regex pattern(int_num);
if(regex_match(test, pattern) { do something}; 

I get the following errors:
/nz/kit.7.2.0.7-P1/sys/cc/bin/i686-rhel5-linux-gnu-g++ -o 
/export/home/nz/DateConvert.o_x86  -fPIC -shared -Wa,--32 -march=prescott
-mfpmath=sse -D__STDC_CONSTANT_MACROS -DGENCODE -DNZDEBUG=0 -DNZ_UDX_COMPILE 
-I/nz/kit.7.2.0.7-P1/sys/include -I/nz/kit.7.2.0.7-P1/sys/include/pg/include
-DLINUX   /export/home/nz/DateConvert.cpp
/export/home/nz/DateConvert.cpp:3:17: error: regex: No such file or directory
/export/home/nz/DateConvert.cpp: In member function 'virtual nz::udx::ReturnValue Dateconvert::evaluate()':
/export/home/nz/DateConvert.cpp:27: error: 'regex' was not declared in this scope
/export/home/nz/DateConvert.cpp:27: error: expected `;' before 'pattern'
/export/home/nz/DateConvert.cpp:45: error: 'pattern' was not declared in this scope
/export/home/nz/DateConvert.cpp:45: error: 'regex_match' was not declared in this scope

Every online example uses these two headers for regex in c++. Why is it not registering when I compile?
This is the compile command by the way:
nzudxcompile /export/home/nz/dateconvert.cpp -o dateconvert.o 
--sig "Dateconvert(VARCHAR(200))" --version 2 --return "VARCHAR(200)" 
--class Dateconvert --user user1 --pw pw1  --db db1

A:

This is not my area of expertise, but it looks to me as if the included regex.h for Netezza UDX development is from the GNU C library which would use regcomp and regexec, rather than regex_match.
The header has an ifdef block for cpp support.
There are a couple of Netezza UDF samples using these functions here.

