Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/235.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
查找[##1]、##2]、##125]的正则表达式。。在php中_Php_Regex - Fatal编程技术网

查找[##1]、##2]、##125]的正则表达式。。在php中

查找[##1]、##2]、##125]的正则表达式。。在php中,php,regex,Php,Regex,查找[##1]、##2]、##125]的正则表达式。。在php中 我有绳子 "php, regu[]lar expre[# # 1]ssio [# # 2]nssadas das dasd as das dasdssd [# # 301]dfs dfsdf sd fsdfds" 想用{number} theString.preg_replace( '/\([#\s#\s[0-9]+\])/', '$1' ); 编辑:好的,这里有一些小错误,但你明白了:p.在PHP中,你是这样做的 $stri

查找[##1]、##2]、##125]的正则表达式。。在php中

我有绳子

"php, regu[]lar expre[# # 1]ssio [# # 2]nssadas das dasd as das dasdssd [# # 301]dfs dfsdf sd fsdfds"
想用
{number}

theString.preg_replace( '/\([#\s#\s[0-9]+\])/', '$1' );

编辑:好的,这里有一些小错误,但你明白了:p.

在PHP中,你是这样做的

$string=preg_replace('/\[#\s#\s([0-9]+)\]/', '$1', $string);
您正在逃离(而不是[我看到您有一个空的“[]”,您想用它做什么?