You are here: Re: Pulling info with Regular Expression... « HTML « IT news, forums, messages
Re: Pulling info with Regular Expression...

Posted by BootNic on 05/28/06 21:41

> "scole954387@gmail.com" <scole954387@gmail.com> wrote:
> news:1148783769.419269.149260@j73g2000cwa.googlegroups.com....
>
> Thanks for the reply.
>
> Actually, this is what I have:
>
> <a
> href=/exec/obidos/tg/browse/-/########/ref=br_bx_c_1_2/104-1330076-7765538>Various
> Text</a>
>
> Using a regular expression (for use with preg_match in PHP), how
> can I just pull out the numbers (##########)?

<?php
$mystring="<a href='http://www.amazon.com/exec/obidos/tg/browse/-/15324461/ref=br_bx_c_1_129/103-6750759-7559044'>some text</a>";
$reg="/\d+/";
preg_match($reg, $mystring, $matches);
print "Numbers are : {$matches[0]}";
?>

--
BootNic Sunday, May 28, 2006 2:41 PM

Have no fear of perfection - you'll never reach it.
*Salvador Dali*

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация