1
lrvy 2017-10-17 11:38:22 +08:00
\bbrush\b:[php|java]; 这样吗?
|
3
2ME 2017-10-17 11:44:17 +08:00
用 phpQuery 提取出来 CLASS 简单一点
|
4
askfilm 2017-10-17 11:53:14 +08:00
|
5
whahuzhihao 2017-10-17 11:54:21 +08:00 1
echo preg_replace('/brush:([^\s\']+)/i', "brush:$1toolbar:false;","<div class='brush:php;'>");
|
8
hadixlin 2017-10-17 13:05:13 +08:00
|
9
vincenth520 2017-10-17 13:08:42 +08:00
```php
<?php $str = "<div class='brush:php;'>"; $key = "brush:(.+);"; $val = "brush:$1;toolbar:false;"; echo preg_replace('/'.$key.'/i',$val,$str); ``` |
10
vincenth520 2017-10-17 13:09:44 +08:00
不支持 markdown,尴尬了
|
11
hibobby 2017-10-17 13:11:33 +08:00
为啥不把"<div class='brush:php;'>";中的 class='brush:php;'提取出来然后分组操作?
|
12
qq641016547 2017-10-17 13:18:47 +08:00
|
14
sucaihuo 2017-10-17 15:56:19 +08:00
进来学习一下
|
15
renminghao 2017-10-17 18:01:27 +08:00
/brush:(\w+?)/
|