|
Posted by Sugapablo on 11/13/56 11:20
Could someone help me out with a regular expression?
I need to be able to search a text field and grab every instance of a
string that falls between <tag class="name"> and </tag>.
We can assume that the tags will always be written properly.
So if the following is my text field: "They streamed across the Clemente
Bridge, docked along the <tag class="name">Allegheny River</tag>, strolled
from the North Side and biked down the trail to watch their Pirates. <br/>
They filled <tag class="name">PNC Park</tag> to the last sliver of
standing-room space on the rotunda, <tag class="name">37,259</a> strong.
<br/> And they came in full throat, chanting and cheering from the outset."
....I'd need the code to return, probably an array, like this:
$array[0] = Allegheny River
$array[1] = PNC Park
$array[2] = 37,259
I just can't get it. Any suggestions?
--
[ Sugapablo ]
[ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
[ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]
[Back to original message]
|