regular expression for find [# # 1] , [# # 2] ,[# # 125] .. in php
i have string
"php, regu[]lar expre[# # 1]ssio [# # 2]nssadas das dasd as das dasdssd [# # 301]dfs dfsdf sd fsdfds"
want to replace all these with {number}
regular expression for find [# # 1] , [# # 2] ,[# # 125] .. in php
i have string
"php, regu[]lar expre[# # 1]ssio [# # 2]nssadas das dasd as das dasdssd [# # 301]dfs dfsdf sd fsdfds"
want to replace all these with {number}
theString.preg_replace( '/\([#\s#\s[0-9]+\])/', '$1' );
Edit: ok, some miner mistakes here but u get the idea :p.
In PHP you do it like this
$string=preg_replace('/\[#\s#\s([0-9]+)\]/', '$1', $string);