Skip to content
⌘ NSIS Forum Archive

NSISpcre - RECaptureMatches macro not found?

5 posts

highend#

NSISpcre - RECaptureMatches macro not found?

Hi,

I wanted to use the NSISpcre plugin (http://nsis.sourceforge.net/NSISpcre_plug-in) but after copying the .dll and .nsh files to the appropriate folders and adding the following to my .nsi script:

  # include this header
!include NSISpcre.nsh
...
# include any functions that will be used in the installer
!insertmacro RESetOption
!insertmacro REClearOption
!insertmacro REGetOption
!insertmacro REClearAllOptions
!insertmacro REMatches
!insertmacro RECaptureMatches
!insertmacro REReplace
I get the following error on compile:
!insertmacro: macro named "RECaptureMatches" not found!
Error in script "D:\Tools\Templates\Default.nsi" on line 27 -- aborting creation process
I'm using NSIS 2.46.5 (unicode).

Is that error fixable? I need the RECaptureMatches macro...
Anders#
This seems like a bug, from a quick look at the .nsh it seems to me like ${RECaptureMatches} is initialized by REMatches.

Even if you fix that I don't think this plugin is Unicode compatible...
highend#
I was able to fix it (by using the !insertmacro commands from the "NSISpcreTest.nsi" file) but the output is em... (for me) unreadable. I guess it's chinese.

	${RECaptureMatches} $0 "([^=]+)=(.+)" "pcre=excellent" 1
MessageBox MB_OK "$0"
My .nsi file used UTF-8 but I also tried it with 1252 encoding (Western European). The output stays the same. Is that still a unicode problem of NSISpcre?