The following is the php regular expression of the parsing template given by the recipient. I want to use it in java because it is a regular expression and I hope you can help me. thank you !! My question: I understand preg_replace (). This method requires three parameters: the first is a regular expression, the second is a string to be replaced, and the third is the template code, the replaced template code is returned. The first parameter in java reports an error. I don't know if the syntax is incorrect. if you want to use it in java, I hope you can give me some advice !! * ** Resolution template ** @ param $ str template content * @ returnture * publicfunction... regexphpjava
The following is the php regular expression of the parsing template given by the recipient. I want to use it in java because it is a regular expression and I hope you can help me. thank you !!
My question: I understand preg_replace (). This method requires three parameters: the first is a regular expression, the second is a string to be replaced, and the third is the template code, the replaced template code is returned. The first parameter in java reports an error. I don't know if the syntax is incorrect. if you want to use it in java, I hope you can give me some advice !!
/**
* Parsing template
*
* @ Param $ str template content
* @ Return ture
*/
Public function template_parse ($ str ){
$ Str = preg_replace ("/{view \ s + (. + )}/"," ", $ Str );
$ Str = preg_replace ("/{template \ s + (. + )}/"," ", $ Str );
$ Str = preg_replace ("/{include \ s + (. + )}/"," ", $ Str );
Return $ str;
}