| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Quality // Join Date: Sep 2008
Posts: 911
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
| | |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I would have a look at the PHP DOM parser to traverse the HTML structure, other XML libraries should do the job as well.
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| | |
| | #5 (permalink) |
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Well, what exactly are you looking for? The best thing to do is to find a single regex that searches for all that you're looking for. Else, you can use a for(); loop or similar to go through multiple regex queries, but preg_match(); will show greater signs of slow downs than str_match(); -RageD |
| | |
| | #6 (permalink) |
| NamePros Regular Join Date: Jul 2007 Location: UK
Posts: 394
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Tested working code: PHP Code: Code:
<ul>
<li>CMS</li>
<li>e-Commerce</li>
</ul> "^" means match the start of the string "." means match any character "*" means zero or more of the previous element "?" means non-greedy (matches as little as possible - be default the regexp will match as many characters as possible) "\s" means match whitespace characters The "i" modifier means cases insensitive The "s" modifier enables multi-line matching So ".*" means match zero or more of any character. Adding the "?" means match as few characters as possible. I added the "\s*" to also capture the indenting before the last <td>.
__________________ |
| | |