-
Positive Salary:
-
2000-3000 RMB , trial salary 60%
I want to take
..
Between non- In the content, with [^ ...] I don't think I can write it, I know. Replace the contents of the. Are there any other matches that can be successfully matched with only one regular?
Reply to discussion (solution)
/
(.*?) (?:<\!\-\-.*?\-->) (.*?) /ius
/
(.*?) (?:<\!\-\-.*?\-->) (.*?) <\/dd>/ius
It might be more efficient to match it first and then replace it.
Chinmo, how do I try not to succeed, did you test?
$s =<<
<>
-
Positive Salary:
-
2000-3000 Yuan , trial salary 60%
html;preg_match ('/
-
(. +?) <\!--. +?--> (. +?) <\/dd>/s ', $s, $m); echo $m [1]. $m [2];
2000-3000 USD
, Trial salary 60%
Chinmo, how do I try not to succeed, did you test?
Well, I don't know how you tested it.
$s = '
-
Positive Salary:
-
2000-3000 USD
, Trial salary 60%
';
Preg_match ('/
(.*?) (?:<\!\-\-.*?\-->) (.*?) <\/dd>/ius ', $s, $m);
echo $m [1]. $m [2];
Anyway, I did the test.
$s = '
-
Positive Salary:
-
2000-3000 yuan , trial salary 60%
';p reg_match ('/
(. *?) (?:<\!\-\-.*?\-->) (.*?) <\/dd>/ius ', $s, $m); echo $m [1]. $m [2];
Results:
Preg_match ("/(. *?) (.*?) /", $STR, $arr);
Echo $arr [2];
/
(.*?) (?:<\!\-\-.*?\-->) (.*?) <\/dd>/is
The U modifier is valid only for UTF-8 encoded data
Besides, you don't have to deal with Chinese.
Is it really that simple?
Preg_match ('/
(. *?) <\/dd>/is ', $s, $m);
Echo Strip_tags ($m [1]);
No wonder, I just was GBK code, no wonder it won't show
Xuzuning method is good, originally PHP and Strip_ Tags This function, is really more convenient.