小编tak*_*oco的帖子

如何在NSIS安装程序中的完成页面上添加桌面快捷方式选项?

我正在尝试首次使用NSIS Modern User Interface创建安装程序.我想知道如何添加一个选项(复选框)供用户选择在完成页面(安装程序的最后一个屏幕)上创建桌面快捷方式,以及已经存在的"运行XXXX"选项.

windows installer nsis

20
推荐指数
2
解决办法
2万
查看次数

如何在Perl中进行全局正则表达式匹配?

我试图在Perl中提出一个匹配多个模式的正则表达式,并像preg_match_allPHP 一样返回所有这些模式.

这就是我所拥有的:

$str = 'testdatastring';
if($str =~ /(test|data|string)/) {
        print "its found index location: $0 $-[0]-$+[0]\n";
        print "its found index location: $1 $-[1]-$+[1]\n";
        print "its found index location: $2 $-[2]-$+[2]\n";
        print "its found index location: $3 $-[3]-$+[3]\n";
}
Run Code Online (Sandbox Code Playgroud)

这只给了我第一场比赛,其中就是'测试'.我希望能够匹配所有出现的指定模式:'test','data'和'string'.

我知道在PHP中,你可以使用preg_match_all来达到这种目的:

if(preg_match_all('/(test|data|string)/', 'testdatastring', $m)) {
        echo var_export($m, true);
}
Run Code Online (Sandbox Code Playgroud)

上面的PHP代码将匹配所有3个字符串:'test','data'和'string'.

我想知道如何在Perl中执行此操作.任何帮助将不胜感激.

php regex perl preg-match-all

1
推荐指数
1
解决办法
8255
查看次数

如何动态引用xdmp中的节点:MarkLogic中的node-replace?

在我的函数update-replace中,我试图通过调用xdmp:node-replace如下所示动态替换MarkLogic中我的一个XML数据源文件中的XML节点:

declare function update-lib:update-rec($doc as xs:string, $path as xs:string, $country as xs:string, $name as xs:string, $population as xs:integer, $latitude as xs:decimal, $longitude as xs:decimal) as document-node() {
    (: read lock acquired :)
    fn:doc($doc),

    xdmp:node-replace(fn:doc($doc)/$path,
        <city>
            <country>{$country}</country>
            <name>{$name}</name>
            <population>{$population}</population>
            <latitude>{$latitude}</latitude>
            <longitude>{$longitude}</longitude>
        </city>
    ),


    (: after the following statement, txn ends and locks released :)
    xdmp:commit()
};
Run Code Online (Sandbox Code Playgroud)

该函数采用7个参数,第一个arg是XML源文件的路径,第二个是XML文件中要更新的节点的路径,其余的对应于子元素值.

当我调用xdmp:node-replace更新数据时,遇到以下错误:

500内部服务器错误

XDMP-ARGTYPE:(错误:XPTY0004)xdmp:node-replace("/ cities/city [3961]",JPMiyoshi56958) - arg1不是node()类型...

所以我决定对arg1进行评估,以确保node()作为node-replace的第一个arg传递:

xdmp:node-replace(xdmp:eval(fn:doc($doc)/$path),
    <city>
        <country>{$country}</country>
        <name>{$name}</name>
        <population>{$population}</population>
        <latitude>{$latitude}</latitude>
        <longitude>{$longitude}</longitude>
    </city>
),
Run Code Online (Sandbox Code Playgroud)

现在我收到以下错误: …

xquery marklogic

0
推荐指数
1
解决办法
1501
查看次数

标签 统计

installer ×1

marklogic ×1

nsis ×1

perl ×1

php ×1

preg-match-all ×1

regex ×1

windows ×1

xquery ×1