使用正则表达式在 Notepad++ 中查找和替换字符串

Find and Replace for a string in Notepad++ using regular expression

我有这个字符串:

MFRR_PRFX_NM (Manufacturer Prefix Name) VARCHAR(1024) NULL

我想用下面的字符串替换上面的行。

cast(NULL as VARCHAR(1024)) as MFRR_PRFX_NM

我曾尝试使用正则表达式,但无法解决这个问题。

这是你想要的吗?

查找内容:(\w+)?.+?(VARCHAR.+) NULL
替换为:cast\(NULL as \) as

不要忘记在替换部分转义括号!