Jump to content

How might I pull this price out of description?


Jeffro

Recommended Posts

okay.. regex is still the hardest thing for me to get, so hoping someone can help with this one. 

 

Can I search my $description, grab the dollar sign and all characters immediately following ...until the next space...  and store that as $price  ? 

 

I'm not using commas or decimal points in $price, so only searching for whole numbers.. though these might be any number of characters ($5, $50, $50000).

 

Many thanks. 

 

Too much trouble to learn it, eh?

'/\$(\d+)/'

Before I gave you the expression, not the PHP string for preg_match() (which apparently you're using, as opposed to MySQL or ereg() or something else).

 

So how would I have use what you gave me?  Just a bit confused and trying to understand. 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.