You are here: Re: regular expression problem « All PHP « IT news, forums, messages
Re: regular expression problem

Posted by billy on 11/03/05 20:51

| Does anyone know if it's possible to use regular expressions to grab
| all content between two words. For example....
|
| ------
| This is some example text to illustrate my problem and here's another
| my for you.
| ------
|
| I want to grab all text between the words 'some' and 'my' with the
| correct result being ' example text to illustrate '
|
| The following doesn't work with either ereg or preg_match...
|
| some([^(my)]+)my

if it's text, regular expressions can do it. ;^)

(?:\bsome\b)(.*?)(?:\bmy\b)

hth,

me

 

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

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