- May
- 13,141
- 180
I'd like to get rid of my plugins dependencies on ONIG.DLL. But I can't get RegularExpression() to work. Below is my current code. I have verified that the regular expression and string are passed correctly and that the string does dontain a match for the regex. This code never finds a match.
Code:
LPWSTR RegExp(LPWSTR pRegEx, LPWSTR pString, LPDWORD pLen)
{
LPWSTR pMatch = NULL;
LPBYTE pstart = NULL, pend = NULL;
UINT uRegions;
if ( !RegularExpression( pRegEx, (LPBYTE) pString, &pstart, &pend, &uRegions, 0, 1, 0 ) && pstart != NULL )
{
pMatch = (LPWSTR) pstart;
*pLen = (DWORD) (pend - pstart)/sizeof(WCHAR);
}
return pMatch;
}