正则,快来帮忙。。
rel="nofollow"><font style="color: Red"> 第178画</font></a><span>(更新于: 2013-06-01 22:06)</span> </h3> <div class="time"> 预计更新时间:<i>暂无更新预告</i></div> </div> <div class="cont"> <a href='#' style="font-weight: 400" target="_blank"> 正如吴王氏所说,连家在此地没有亲族,没有近枝。连老爷子就是唯一的大家长,他头上既没有长辈压服,旁边也没有同辈的人谏阻。关于连家的家务事,像这样不留情面,一阵见血的话,谁会当面跟他说?<br> 虽然连<br> ……</a></div> <div class="opt">
正则,获取,
====================
第178花画
=======================
2013-06-01 22:06
=====================
正如吴王氏所说,连家在此地没有亲族,没有近枝。连老爷子就是唯一的大家长,他头上既没有长辈压服,旁边也没有同辈的人谏阻。关于连家的家务事,像这样不留情面,一阵见血的话,谁会当面跟他说?
虽然连
================================
一遇到要换行的,我就搞不了了。超晕。
回复讨论(解决方案)
$reh="/\.*\<\/a\>;
if(preg_macth($reg,$str,$arr)){
return true;
}else{
return false
}
print_r($arr);
试试
这正则比较恶搞,搞了1晚了我。
<?php $str='rel="nofollow"><font style="color: Red"> 第178画</font></a><span>(更新于: 2013-06-01 22:06)</span> </h3> <div class="time"> 预计更新时间:<i>暂无更新预告</i></div> </div> <div class="cont"> <a href=\'#\' style="font-weight: 400" target="_blank"> 正如吴王氏所说,连家在此地没有亲族,没有近枝。连老爷子就是唯一的大家长,他头上既没有长辈压服,旁边也没有同辈的人谏阻。关于连家的家务事,像这样不留情面,一阵见血的话,谁会当面跟他说?<br> 虽然连<br> ……</a></div> <div class="opt">';preg_match('/<font.*?>(.*?)<\/font>.*?\(更新于.*?(\d{4}-\d{2}-\d{2}\s*\d{2}:\d{2}).*?<div class="cont">.*?<a.*?>(.*?)<\/a><\/div>/s', $str, $matches);var_dump($matches);
耐心点,没啥恶心的。
matches数组的$matches[1] $matches[2] $matches[3]就是你要的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Golang regular expressions use the pipe character | to match multiple words or strings, separating each option as a logical OR expression. For example: matches "fox" or "dog": fox|dog matches "quick", "brown" or "lazy": (quick|brown|lazy) matches "Go", "Python" or "Java": Go|Python |Java matches words or 4-digit zip codes: ([a-zA

PHP regular expressions are a powerful tool for text processing and conversion. It can effectively manage text information by parsing text content and replacing or intercepting it according to specific patterns. Among them, a common application of regular expressions is to replace strings starting with specific characters. We will explain this as follows

How to remove Chinese in PHP using regular expressions: 1. Create a PHP sample file; 2. Define a string containing Chinese and English; 3. Use "preg_replace('/([\x80-\xff]*)/i', '',$a);" The regular method can remove Chinese characters from the query results.

In this article, we will learn how to remove HTML tags and extract plain text content from HTML strings using PHP regular expressions. To demonstrate how to remove HTML tags, let's first define a string containing HTML tags.

Sharing tips on using PHP regular expressions to implement the Chinese replacement function. In web development, we often encounter situations where Chinese content needs to be replaced. As a popular server-side scripting language, PHP provides powerful regular expression functions, which can easily realize Chinese replacement. This article will share some techniques for using regular expressions to implement Chinese substitution in PHP, and provide specific code examples. 1. Use the preg_replace function to implement Chinese replacement. The preg_replace function in PHP can be used

When developing websites and applications, it is crucial to verify the correctness and format of input data. In PHP, regular expressions are a powerful tool that can be used to validate and format various types of data. Among them, validating input data as numbers is a very common requirement. In this article, we will discuss how to use regular expressions in PHP to validate input data as numbers.

Website security has attracted more and more attention, and using the HTTPS protocol to ensure the security of data transmission has become an important part of current website development. In PHP development, how to use regular expressions to verify whether the URL is HTTPS protocol? here we come to find out. Regular expression Regular expression is an expression used to describe rules. It is a powerful tool for processing text and is widely used in text matching, search and replacement. In PHP development, we can use regular expressions to match http in the URL

When using PHP for string operations, you may encounter situations where fixed Chinese characters need to be replaced. At this time, using regular expressions can solve this problem well.
