You are here: Re: Simple Regular Expression ? « All PHP « IT news, forums, messages
Re: Simple Regular Expression ?

Posted by Rik on 06/26/06 13:18

McHenry wrote:
> Why could we not simply have used as this is what I tried and it
> didn't work ?
> <h3>.*?(?P<field2>[0-9\.,]*).*?</h3>

1. It matches a single dot or comma, not desired.
2. It matches 'nothing' (* = 0 or more)

In <h3>.*?(?P<field2>[0-9]+[0-9\.,]*).*?</h3>, we use [0-9]+ to say: once
you have found at least 1 number, and maybe more, capture all numbers,
comma's and dot's.

Grtz,
--
Rik Wasmus

 

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

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