What does a regular expression mean: $ con = preg_replace ('/shop_rate_list \ (.) \)/S',' $ 1', $ con); solution
Source: Internet
Author: User
What does a regular expression mean: $ con = preg_replace ('/shop_rate_list \((. *) \)/S', '$ 1', $ con); preg_replace ('/shop_rate_list \((. *) \)/S', '$ 1', $ con); & nbsp; find the detailed explanation of this regular expression. what does preg_repl mean by finding a regular expression: $ con = preg_replace ('/shop_rate_list \((. *) \)/S', '$ 1', $ con );
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 ().
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.