Skip to content
⌘ NSIS Forum Archive

NSISpcre plugin | Regular expression not work

2 posts

baby123#

NSISpcre plugin | Regular expression not work

Hello,

I'm trying to use:

with the following code:

${REReplace} $0 "[^A-Z^a-z^0-9]" "123ABC456xcv" "_" 1
MessageBox MB_OK 'fixed: $0'
which i would like to replace all chars that are not (a-z, A-z, 0-9)
but it gives back EMPTY STRING.

Am i missing something?
baby123#
I found out that it happen, if no replace found.
the fix, is to add some chat that will be always replaced (match to REGEX):
(i used _ char)

${REReplace} $0 "[^A-Z^a-z^0-9]" "123ABC456xcv_" "_" 1
MessageBox MB_OK 'fixed: $0'