Replacement structure How do you write the regular?
In the page:
ISO Preface
Introduction
Switch
ISO Preface
Introduction
$ptext is the content of the page. It's like I'm going to use a reverse reference.
PHP Code
Guidance.
------Solution--------------------
PHP Code
$s = <<< txt page: ISO preface introduction Txt;echo preg_replace (' # title= ". +?/([^]+)" [^>]+> ([^<]+) < #iU ', ' >$2 < ', $s);
------Solution--------------------
discuss
PHP Code
$s = <<< TXT
In the page:
ISO Preface
------Solution--------------------
([^]+) "[^>]+> ([^<]+)
([^]+) This part is a match URL, the general URL does not exist empty
"Is the end of the URL.
[^>]+> is everything that matches not >, that is, there may be other attributes in that tag. Then to the end of the > Header
([^<]+) This is the content of the tag, there is no < (this is the latter part of the label)
Probably this way, I do not know whether I can say that.
------Solution--------------------
Don't really understand this, .... Divert wrote a
PHP Code
$str =<<
<><\ div="">
'; $replace = ' $ $ '; Echo preg_replace ("/$REGEXP/", $replace, $STR);
------Solution--------------------
PHP Code
<\>