|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
<clip>
> http://www.ezee.se/tests/para_regex2.php.txt Yep, sorry... Just add the s preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray); </clip> Sweeeeett! It works! If you _do get time_, would love to know the actual meaning of |<p[^>]*>(.*)</p>|Uis because although I do appreciate the and the code, am learning to work a bit with regex and this is still quite advanced for me. So far I have gotten (correct me if I am wrong) |<p[^>]*> = 1) Starts with "<p" 2) can have anything between till the next > 3) end with ">" (.*)</p>| = 1) can have whatever inbetween till the end which is "</p>" Have no idea of the Uis switches... Thanks again, R __________________________________________________ __________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Pretty close.
The only thing I'd suggest is a different way of wording step 2: Can contain anything but '>' until step 3. As for the switches/modifiers (Uis), check out: http://us.php.net/manual/en/referenc....modifiers.php U = ungreedy i = case-insensitive (|p| matches 'p' and/or 'P') s = treat as single line - Jon L. On Wed, May 7, 2008 at 1:51 PM, Ryan S <genphp@yahoo.com> wrote: > <clip> > > http://www.ezee.se/tests/para_regex2.php.txt > > Yep, sorry... Just add the s > > preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray); > > </clip> > > Sweeeeett! It works! > If you _do get time_, would love to know the actual meaning of > |<p[^>]*>(.*)</p>|Uis > because although I do appreciate the and the code, am learning to > work a bit with regex > and this is still quite advanced for me. > So far I have gotten (correct me if I am wrong) > |<p[^>]*> = 1) Starts with "<p" 2) can have anything between till the > next > 3) end with ">" > (.*)</p>| = 1) can have whatever inbetween till the end which is "</p>" > > Have no idea of the Uis switches... > > Thanks again, > R > > > > > __________________________________________________ __________________________________ > Be a better friend, newshound, and > know-it-all with Yahoo! Mobile. Try it now. > http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > |
|
![]() |
| Outils de la discussion | |
|
|