|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-08-13 10:29 UTC] funpersian989moji at yahoo dot com
Description: ------------ problem in regular expressions Reproduce code: --------------- hi i can't best speak english i am sorry i a problem in regular expressions help me my html code is: ==========================================< <hr><b>Really example1</b> : <i><a href=http://www.example1.com/a4.htm>www.example1.com/a4.htm</a></i><hr> <UL><LI><a href="http://www.example1.com/get.php?id=164702">Systems example0</a> 1<LI><a href="http://www.example1.com/get.php?id=177691">Systems example1</a> 2<LI><a href="http://www.example1.com/get.php?id=177702">Systems example2</a> 3<LI><a href="http://www.example1.com/get.php?id=154547">Systems example3</a> 4<LI><a href="http://www.example1.com/get.php?id=177692">Systems example4</a> 5<LI><a href="http://www.example1.com/get.php?id=177699">Systems example5</a> 6<LI><a href="http://www.example1.com/get.php?id=209311">Systems example6</a> 7<LI><a href="http://www.example1.com/get.php?id=177703">Systems example7</a> 8<LI><a href="http://www.example1.com/get.php?id=164102">Systems example8</a> 10<LI><a href="http://www.example1.com/get.php?id=164703">Systems example9</a> <LI>. . . . .<br> </UL><hr><b>Really example2</b> : <i><a href=http://www.example2.com/l5.htm>www.example2.com/l5.htm</a></i><hr> <UL>1<LI><a href="http://www.example2.com/get.php?id=114301">example2 example2</a> 2<LI><a href="http://www.example2.com/get.php?id=114304">Systems example2</a> 3<LI><a href="http://www.example2.com/get.php?id=114302">Systems example2</a> </UL> ============================================> my regular expressions code is: ================================= <hr><b>([^<]*)</b>[^<]*<i><a\\s[^>]*href\\s*=\\s*([^\\s>]+)[^>]*>([^<]*)</a></i><hr> ==================================== i how regular expressions code display result of line from 1-10 plesae help me me email funpersian989moji@yahoo.com very thanks PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 00:00:02 2025 UTC |
This aren't a bug. preg_match_all('/(?<!<ul>)<li><a href="([^"]+)">([^<]+)<\/a>/i', $str, $matches); And array_slice() function can help you.