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
[Back to original message]
|