Backreferenced regexp in JFolder::files and folders
Posted: Thu Mar 20, 2008 11:22 pm
- IntroductionCurrently, when traversing a folder for files or folders, the complete file/folder name is returned. I see a need to be able to, for instance, return the filename without an extension, or a substring of the folder name.
- Technical ImplementationThis would simply involve the use of the regexp backreference system to allow the user to specify a filter like /(.+)\..+/ returning the first backreference as the name, instead of the whole name.
- ImpactThis should not affect the current implementation, unless the programmer has used backref brackets in their regexp for their own requirements (they are currently ignored by Joomla). Non-capturing parentheses (?..) would not be affected.
If used, this would override the fullpath parameter (which defaults to false anyway).