Solve a regular expression PHPcodeechopreg_replace (& quot; | browse .*\? Lm0 & amp; word & amp; pn (. *) & quot; & gt ;\[(. *) \] | isu",_get=id=."-=1.html & quot; & gt; $2 & quot;, $ value); to solve a regular expression
PHP code
Echo preg_replace ("|/browse /.*\\? Lm = 0 & word = & pn = (. *) \ "> \\[(. *) \] | isU ", $ _ GET ['id']. "-\ users 1.html \"> \ $2 ", $ value );
\\? What does this mean? why do we need to add two \? and \\[(. *) \] I don't know what this means. isn't it just a good escape? Could you explain it to me?
------ Solution --------------------
\\= \
------ Solution --------------------
? 0 or multiple times. Prevents greedy matching.
\ [(. *) \] Actually.
------ Solution --------------------
\\?
Indicates matching a possible "\" character
\ Is an escape character, so \ needs to be escaped as a character \\
? Matches 0 to 1 characters