[pmwiki-devel] Regex and recipe philosphy

Peter Bowers pbowers at pobox.com
Sat Jul 13 08:22:07 CDT 2013


On Fri, Jul 12, 2013 at 11:39 PM, Simon <nzskiwi at gmail.com> wrote:

> most directives accept anything within their scope, then use
> $arg = ParseArgs($args);
>
> Then the arguments defined are processed, and any unexpected arguments are
> disregarded.
>
> So my corollary question is:
> Is this good practice, or just expedient, given the difficulty (as I
> perceive it) of defining a parameter list in regex?
>

Yes, both. It's good practice as well as being expedient.  As already
mentioned ParseArgs() is well-tested, elegant code which saves a developer
a ton of time.  At the same time its ability to handle positional or named
parameters and to allow parameters to be specified in any order allows
great flexibility on the part of users entering markup in pages (consider
how difficult it would be if you had to remember the exact order of each
parameter in a complex markup such as pagelist).

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20130713/d669b913/attachment.html>


More information about the pmwiki-devel mailing list