What does a regular expression mean: $ conpreg_replace (shop_rate_list ((. *) s, $1, $ con); preg_replace (shop_rate_list ((. *) s, $1, $ con); & nbsp; find the detailed explanation of the regular expression ------ solution ------------------ preg_replac what does a regular expression mean: $ con = preg_replace ('/shop_rate_list \((. *) \)/S', '$ 1', $ con );
Preg_replace ('/shop_rate_list \ (. *) \)/S',' $ 1', $ con );
Detailed explanation of this regular expression
------ Solution --------------------
Preg_replace ('/shop_rate_list \ (. *) \)/S',' $ 1', $ con );
1)
'/Shop_rate_list \ (. *) \)/s'
/And/s
Start and end. adding s is case insensitive.
Shop_rate) list \(
Because () is a special symbol, \ (\) conversion is required.
(. *) All content.
2)
'$ 1' can be interpreted as a variable to obtain the content in the 1st appearance () of a regular expression.
If 1st times () appears, then $1 2nd times, then $2 and so on.
Therefore, it means to get shop_rate_list \ (. *) \), and $1 gets the content in () in shop_rate_list ().