[pmwiki-users] php match q

Patrick R. Michaud pmichaud at pobox.com
Thu Jul 12 12:43:51 CDT 2007


On Tue, Jul 10, 2007 at 07:07:09PM +0200, noskule wrote:
> hi list
> I would like to find out if a string occurs in a value and tried the
> match condition
> 
> $showfields = FieldAFieldBFieldC
> 
> 
> (:if match '{$sowhfields}' FieldA:)
> ...formfield
> (:if match '{$sowhfields}' FieldB:)
> ...formfield
> 
> 
> is there a way how to do it?

At present there's not a good way to do it.

There is a 'match' condition present in PmWiki, but as part of 2.2.0
beta I've been planning to change it so that it uses wildcards
instead of regular expressions.  When this is implemented,
one can do:

    (:if match <pattern> <value>:)

So, in the above, it would be

    (:if match *FieldA* '{$sowhfields}':)

which would determine if a page variable contains "FieldA".

The ability to match on a regular expression, if I decide to keep
it, will undoubtedly become (:if regex ... :) .

Pm



More information about the pmwiki-users mailing list