You are here: Re: REGEXP problem « PHP Programming Language « IT news, forums, messages
Re: REGEXP problem

Posted by John Dunlop on 10/12/06 15:59

frizzle:

> Imagine the filename is index_en.html
> My output needs to be an array with the following:
> language => en (no underscore)
> file => index (no "_en")
> extension => html

Making some assumptions (untested):

<^([^_.]*)(_([^.]*))?\.(.*)$>i

Applied to "index_en.html":

0 = "index_en.html"
1 = "index"
2 = "_en"
3 = "en"
4 = "html"

Applied to "index.html":

0 = "index.html"
1 = "index"
2 = ""
3 = ""
4 = "html"

--
Jock

 

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

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