Hi all, I'm using Yahoo Pipes to mashup an RSS feed, but I'm not really familiar with Regex. I need a regex expression to get rid of everything after the price (which will always change) Here's an example: 325 11 1 $120.00 <span class="e">each</span><a rel="nofollow" target="_blank" href="http://www.iwantseasonstickets.com/britney-spears-tickets/britney-spears-vancouver-general-motors-place-canada-hockey-place-4-8-2009-764674/?id=166175013"</a> All I want to end up with is: 325 11 1 $120.00 Can anyone tell me how to do thisÉ Thanks!!
<?php $string = '325 11 1 $120.00 <span class="e">each</span><a rel="nofollow" target="_blank" href="http://www.iwantseasonstickets.com/britney-spears-tickets/britney-spears-vancouver-general-motors-place-canada-hockey-place-4-8-2009-764674/?id=166175013"</a>'; $new_string = trim(substr($string, 0, strpos($string, ' <span class="e">'))); echo $new_string; PHP:
if you really need regex. preg_match("/^[^<]+?/", $string, $matches); $matches = rtrim($matches[0]); PHP: