$result = preg_replace(
"/\{([<>])([a-zA-Z0-9_]*)(\?{0,1})([a-zA-Z0-9_]*)\}(.*)\{\\1\/\\2\}/iseU",
"CallFunction('\\1','\\2','\\3','\\4','\\5')",
$result
);
Run Code Online (Sandbox Code Playgroud)
上面的代码在升级到PHP 5.5后给出了弃用警告:
不推荐使用:preg_replace():不推荐使用/ e修饰符,而是使用preg_replace_callback
如何更换代码preg_replace_callback()?
2个面板:
Ext.create('Ext.Container', {
fullscreen: true,
layout: 'hbox',
items: [
{
xtype: 'panel',
html: 'message list',
flex: 1,
items: [
{
xtype: 'list',
itemTpl: '{title}',
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
}
]
},
{
xtype: 'panel',
html: 'message preview',
flex: 3
}
]
});
Run Code Online (Sandbox Code Playgroud)
第一个面板列表对象中没有指定高度属性,因此无法显示.如何在xtype:'list'中设置100%的高度?
为字符串编写 python 正则表达式。我希望字符串至少为 1 个符号,最多为 30 个。问题是我在正则表达式字母中使用了 3 个子块,因此长度必须为 3 个字符。是否可以在此正则表达式中添加该条件(1-30 个字符长度):
regex = re.compile("^[a-zA-Z]+[a-zA-Z0-9\.\-]+[a-zA-Z0-9]$")
r = regex.search(login)
Run Code Online (Sandbox Code Playgroud)
谢谢你。
刚开始使用Docker.对linux容器有一些疑问)
如何在Debian安装的操作系统上运行Ubuntu映像?或者它只是一个名为'Ubuntu'的图像名称,实际上使用Debian环境......
# cat /proc/version
Linux version 3.16.0-0.bpo.4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.16.7-ckt2-1~bpo70+1 (2014-12-08)
# docker run -i -t ubuntu
root@bcade5ce3b94:/# cat /proc/version
Linux version 3.16.0-0.bpo.4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.16.7-ckt2-1~bpo70+1 (2014-12-08)
Run Code Online (Sandbox Code Playgroud)
文件系统怎么样?它使用相同的已安装组件或仅依赖内核的新fs架构?
也许有关于这个主题的好文章)
docker ×1
lxc ×1
lxc-docker ×1
php ×1
php-5.5 ×1
preg-replace ×1
python ×1
python-2.7 ×1
regex ×1